Index: content/browser/renderer_host/media/video_capture_controller.cc |
diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc |
index 8ff97bdf767d93c8821ef401ec33b229dfc31348..fa032c67ecdb0385f29c3dbb08f6430eb632a555 100644 |
--- a/content/browser/renderer_host/media/video_capture_controller.cc |
+++ b/content/browser/renderer_host/media/video_capture_controller.cc |
@@ -469,6 +469,17 @@ void VideoCaptureController::VideoCaptureDeviceClient::OnIncomingCapturedData( |
NOTREACHED(); |
} |
+ // The input |length| can be greater than the required buffer size because of |
+ // paddings and/or alignments, but it cannot be less. However, on some |
+ // platforms, such as Win with C920 webcams, |length| is set as 0, and we need |
+ // to take that into account. |
+#if defined(OS_WIN) |
+ DCHECK(length == 0 || |
+ static_cast<size_t>(length) >= frame_format.ImageAllocationSize()); |
perkj_chrome
2015/02/10 08:01:00
please fix the problem at its source instead. ie,
|
+#else |
+ DCHECK_GE(static_cast<size_t>(length), frame_format.ImageAllocationSize()); |
+#endif |
+ |
if (libyuv::ConvertToI420(data, |
length, |
yplane, |