Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Unified Diff: content/browser/renderer_host/media/video_capture_device_client.cc

Issue 2369983003: Win video capture: Fix capture format and frame buffer mismatch (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/video_capture_device_client.cc
diff --git a/content/browser/renderer_host/media/video_capture_device_client.cc b/content/browser/renderer_host/media/video_capture_device_client.cc
index a70f59921ce5e42a5c00ae38a0fbf1569ae03267..86aebf9844d6df9ac3da5447c32c4e50789a1317 100644
--- a/content/browser/renderer_host/media/video_capture_device_client.cc
+++ b/content/browser/renderer_host/media/video_capture_device_client.cc
@@ -217,7 +217,13 @@ void VideoCaptureDeviceClient::OnIncomingCapturedData(
// The input |length| can be greater than the required buffer size because of
// paddings and/or alignments, but it cannot be smaller.
- DCHECK_GE(static_cast<size_t>(length), frame_format.ImageAllocationSize());
+ if (static_cast<size_t>(length) < frame_format.ImageAllocationSize()) {
mcasas 2016/09/27 14:36:01 IIUC, the DCHECK has never been hit before except
magjed_chromium 2016/09/27 15:19:56 ManyCam doesn't work for the bug reporter in any b
mcasas 2016/09/28 16:39:22 I'm not sure this is the right thing to do. 1- si
magjed_chromium 2016/09/29 11:00:35 1. That's an unrelated change, but sure, I moved t
mcasas 2016/09/29 20:43:31 The crash is only present in Win, and Manycam is a
+ DLOG(WARNING) << "Frame format: "
+ << media::VideoCaptureFormat::ToString(frame_format)
+ << " requires at least " << frame_format.ImageAllocationSize()
+ << " bytes, but only " << length << " bytes was given.";
mcasas 2016/09/27 14:36:01 Who is going to read this DLOG anyway? Code in med
magjed_chromium 2016/09/27 15:19:56 I don't know if anyone will use it. We can remove
mcasas 2016/09/28 16:39:22 Yes, by all means, but probably you would revert
+ return;
+ }
if (external_jpeg_decoder_) {
const VideoCaptureGpuJpegDecoder::STATUS status =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698