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

Unified Diff: media/base/video_frame.cc

Issue 1267003004: Revert to zero-initializing buffers for FFmpegVideoDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Returning 0 for default. Created 5 years, 4 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
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index f80f9aa31004328acf531bb67c511c833f476bae..8cd2fd8273c2c6265619bcd12583b81391e81c7a 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -805,6 +805,7 @@ VideoFrame::VideoFrame(VideoPixelFormat format,
coded_size_(coded_size),
visible_rect_(visible_rect),
natural_size_(natural_size),
+ allocated_size_(0),
shared_memory_handle_(base::SharedMemory::NULLHandle()),
shared_memory_offset_(0),
timestamp_(timestamp),
@@ -895,11 +896,13 @@ void VideoFrame::AllocateYUV() {
uint8* data = reinterpret_cast<uint8*>(
base::AlignedAlloc(data_size, kFrameAddressAlignment));
-
for (size_t plane = 0; plane < NumPlanes(format_); ++plane)
data_[plane] = data + offset[plane];
AddDestructionObserver(base::Bind(&base::AlignedFree, data));
+
+ // Make sure that allocated_size() returns the same size as allocated here.
+ allocated_size_ = data_size;
}
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698