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

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

Issue 9837095: [Coverity] Fixed frame size (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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/video/capture/fake_video_capture_device.h ('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
===================================================================
--- media/video/capture/fake_video_capture_device.cc (revision 129014)
+++ media/video/capture/fake_video_capture_device.cc (working copy)
@@ -41,7 +41,8 @@
: device_name_(device_name),
observer_(NULL),
state_(kIdle),
- capture_thread_("CaptureThread") {
+ capture_thread_("CaptureThread"),
+ frame_size_(0) {
}
FakeVideoCaptureDevice::~FakeVideoCaptureDevice() {
@@ -75,6 +76,7 @@
current_settings.width * current_settings.height * 3 / 2;
fake_frame_.reset(new uint8[fake_frame_size]);
memset(fake_frame_.get(), 0, fake_frame_size);
+ frame_size_ = fake_frame_size;
state_ = kAllocated;
observer_->OnFrameInfo(current_settings);
@@ -118,7 +120,7 @@
}
// Give the captured frame to the observer.
observer_->OnIncomingCapturedFrame(fake_frame_.get(),
- sizeof(fake_frame_.get()),
+ frame_size_,
base::Time::Now());
// Reschedule next CaptureTask.
capture_thread_.message_loop()->PostDelayedTask(
« no previous file with comments | « media/video/capture/fake_video_capture_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698