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

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

Issue 11961051: Merge 176816 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: 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 | « no previous file | content/common/gpu/media/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/gpu_video_decode_accelerator.cc
===================================================================
--- content/common/gpu/media/gpu_video_decode_accelerator.cc (revision 177492)
+++ content/common/gpu/media/gpu_video_decode_accelerator.cc (working copy)
@@ -205,6 +205,11 @@
void GpuVideoDecodeAccelerator::OnDecode(
base::SharedMemoryHandle handle, int32 id, uint32 size) {
DCHECK(video_decode_accelerator_.get());
+ if (id < 0) {
+ DLOG(FATAL) << "BitstreamBuffer id " << id << " out of range";
+ NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT);
+ return;
+ }
video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size));
}
@@ -224,6 +229,11 @@
std::vector<media::PictureBuffer> buffers;
for (uint32 i = 0; i < buffer_ids.size(); ++i) {
+ if (buffer_ids[i] < 0) {
+ DLOG(FATAL) << "Buffer id " << buffer_ids[i] << " out of range";
+ NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT);
+ return;
+ }
gpu::gles2::TextureManager::TextureInfo* info =
texture_manager->GetTextureInfo(texture_ids[i]);
if (!info) {
« no previous file with comments | « no previous file | content/common/gpu/media/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698