Index: content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc |
diff --git a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc |
index 06091a36b4d04cd73352d3c6ab233a5990670883..7f6e9baa87f59afb4b8a54ca61a6ed6c65dc8cbd 100644 |
--- a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc |
+++ b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc |
@@ -233,6 +233,14 @@ void V4L2JpegDecodeAccelerator::Decode( |
<< ", size=" << bitstream_buffer.size(); |
DCHECK(io_task_runner_->BelongsToCurrentThread()); |
+ if (bitstream_buffer.id() < 0) { |
+ LOG(ERROR) << "Invalid bitstream_buffer, id: " << bitstream_buffer.id(); |
+ if (base::SharedMemory::IsHandleValid(bitstream_buffer.handle())) |
+ base::SharedMemory::CloseHandle(bitstream_buffer.handle()); |
+ PostNotifyError(bitstream_buffer.id(), INVALID_ARGUMENT); |
+ return; |
+ } |
+ |
if (video_frame->format() != media::PIXEL_FORMAT_I420) { |
PostNotifyError(bitstream_buffer.id(), UNSUPPORTED_JPEG); |
return; |