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

Unified Diff: media/capture/video/win/video_capture_device_win.cc

Issue 2369983003: Win video capture: Fix capture format and frame buffer mismatch (Closed)
Patch Set: Move length check to Win code 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 | « media/capture/video/video_capture_device_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/win/video_capture_device_win.cc
diff --git a/media/capture/video/win/video_capture_device_win.cc b/media/capture/video/win/video_capture_device_win.cc
index 249bfedf58505eaab9222685a26f5c4e288afe50..3487d1e20a6d2bd4492f2cee4625a9420e0832a4 100644
--- a/media/capture/video/win/video_capture_device_win.cc
+++ b/media/capture/video/win/video_capture_device_win.cc
@@ -457,6 +457,11 @@ void VideoCaptureDeviceWin::TakePhoto(TakePhotoCallback callback) {
void VideoCaptureDeviceWin::FrameReceived(const uint8_t* buffer,
int length,
base::TimeDelta timestamp) {
+ if (static_cast<size_t>(length) < capture_format_.ImageAllocationSize()) {
+ DLOG(WARNING) << "Media sample buffer with insufficient size.";
+ return;
mcasas 2016/09/29 20:43:31 With this we will just be ignoring the incoming fr
+ }
+
if (first_ref_time_.is_null())
first_ref_time_ = base::TimeTicks::Now();
« no previous file with comments | « media/capture/video/video_capture_device_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698