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

Unified Diff: media/video/capture/fake_video_capture_device.cc

Issue 7003140: Fix two bugs found by a new clang warning I'm currently testing: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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 | « base/md5.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/fake_video_capture_device.cc
diff --git a/media/video/capture/fake_video_capture_device.cc b/media/video/capture/fake_video_capture_device.cc
index 768271428d2f8c181ed0b20fdb9e994221b821b2..9de3a40d68fe2b050d214b1e723095c27a072a9f 100644
--- a/media/video/capture/fake_video_capture_device.cc
+++ b/media/video/capture/fake_video_capture_device.cc
@@ -70,9 +70,10 @@ void FakeVideoCaptureDevice::Allocate(int width,
current_settings.frame_rate = 30;
}
- fake_frame_.reset(new uint8[current_settings.width *
- current_settings.height * 3 / 2]);
- memset(fake_frame_.get(), 0, sizeof(fake_frame_.get()));
+ size_t fake_frame_size =
+ current_settings.width * current_settings.height * 3 / 2;
+ fake_frame_.reset(new uint8[fake_frame_size]);
+ memset(fake_frame_.get(), 0, fake_frame_size);
state_ = kAllocated;
observer_->OnFrameInfo(current_settings);
« no previous file with comments | « base/md5.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698