From 701567a864b9cc588c0e53e8a2bc5d4bc4137d7f Mon Sep 17 00:00:00 2001 From: "mikhal@webrtc.org" Date: Fri, 9 Nov 2012 18:45:12 +0000 Subject: [PATCH] Capture module: Fixing size computation for u and v planes TEST=trybots Review URL: https://webrtc-codereview.appspot.com/932017 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3070 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/video_capture/video_capture_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/video_capture/video_capture_impl.cc b/webrtc/modules/video_capture/video_capture_impl.cc index 5512d4ec08..e73b67233d 100644 --- a/webrtc/modules/video_capture/video_capture_impl.cc +++ b/webrtc/modules/video_capture/video_capture_impl.cc @@ -342,8 +342,8 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrameI420( CriticalSectionScoped cs(&_callBackCs); int size_y = video_frame.height * video_frame.y_pitch; - int size_u = video_frame.u_pitch * (video_frame.height + 1) / 2; - int size_v = video_frame.v_pitch * (video_frame.height + 1) / 2; + int size_u = video_frame.u_pitch * ((video_frame.height + 1) / 2); + int size_v = video_frame.v_pitch * ((video_frame.height + 1) / 2); // TODO(mikhal): Can we use Swap here? This will do a memcpy. int ret = _captureFrame.CreateFrame(size_y, video_frame.y_plane, size_u, video_frame.u_plane,