Index: content/browser/renderer_host/media/video_capture_buffer_pool.cc |
diff --git a/content/browser/renderer_host/media/video_capture_buffer_pool.cc b/content/browser/renderer_host/media/video_capture_buffer_pool.cc |
index 207f86a99f3df42cea42f8402ddaf3dacdd2f856..f8d3a25e5a2e03b9f66cf5e1e3911e04cf5b925d 100644 |
--- a/content/browser/renderer_host/media/video_capture_buffer_pool.cc |
+++ b/content/browser/renderer_host/media/video_capture_buffer_pool.cc |
@@ -128,8 +128,10 @@ int VideoCaptureBufferPool::RecognizeReservedBuffer( |
scoped_refptr<media::VideoFrame> VideoCaptureBufferPool::ReserveI420VideoFrame( |
const gfx::Size& size, |
int rotation) { |
- if (static_cast<size_t>(size.GetArea() * 3 / 2) != GetMemorySize()) |
+ if (GetMemorySize() != |
+ media::VideoFrame::AllocationSize(media::VideoFrame::I420, size)) { |
return NULL; |
+ } |
base::AutoLock lock(lock_); |
@@ -151,6 +153,7 @@ scoped_refptr<media::VideoFrame> VideoCaptureBufferPool::ReserveI420VideoFrame( |
gfx::Rect(size), |
size, |
static_cast<uint8*>(buffer->shared_memory.memory()), |
+ GetMemorySize(), |
buffer->shared_memory.handle(), |
base::TimeDelta(), |
disposal_handler); |