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

Unified Diff: content/common/gpu/media/video_decode_accelerator_unittest.cc

Issue 11826064: Enforce non-negative BitstreamBuffer id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid wrapping signed integers. Created 7 years, 11 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: content/common/gpu/media/video_decode_accelerator_unittest.cc
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index f325b40c8fcd317f72648a9fc05fdf9285775246..ad755d4af237c1d45bf4401031349314151efc53 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -603,7 +603,8 @@ void GLRenderingVDAClient::DecodeNextFragments() {
base::SharedMemoryHandle dup_handle;
CHECK(shm.ShareToProcess(base::Process::Current().handle(), &dup_handle));
media::BitstreamBuffer bitstream_buffer(
- next_bitstream_buffer_id_++, dup_handle, next_fragment_size);
+ next_bitstream_buffer_id_, dup_handle, next_fragment_size);
+ next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF;
Ami GONE FROM CHROMIUM 2013/01/10 23:41:31 lolololol
decoder_->Decode(bitstream_buffer);
++outstanding_decodes_;
encoded_data_next_pos_to_decode_ = end_pos;

Powered by Google App Engine
This is Rietveld 408576698