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

Unified Diff: webkit/plugins/ppapi/ppb_video_decoder_impl.cc

Issue 11826064: Enforce non-negative BitstreamBuffer id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Documented the wrapping at 30 bits. 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
« no previous file with comments | « ppapi/c/dev/pp_video_dev.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_video_decoder_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
index 06c8a56fc6b826ba4153d0d970b13026b2387e79..f1f7ed216d6e73ceb62914228796431652cfa0c6 100644
--- a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
+++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
@@ -139,6 +139,7 @@ int32_t PPB_VideoDecoder_Impl::Decode(
return PP_ERROR_FAILED;
PPB_Buffer_Impl* buffer = static_cast<PPB_Buffer_Impl*>(enter.object());
+ DCHECK_GE(bitstream_buffer->id, 0);
media::BitstreamBuffer decode_buffer(
bitstream_buffer->id,
buffer->shared_memory()->handle(),
@@ -160,6 +161,7 @@ void PPB_VideoDecoder_Impl::AssignPictureBuffers(
std::vector<media::PictureBuffer> wrapped_buffers;
for (uint32 i = 0; i < no_of_buffers; i++) {
PP_PictureBuffer_Dev in_buf = buffers[i];
+ DCHECK_GE(in_buf.id, 0);
media::PictureBuffer buffer(
in_buf.id,
gfx::Size(in_buf.size.width, in_buf.size.height),
« no previous file with comments | « ppapi/c/dev/pp_video_dev.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698