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

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

Issue 1706023003: Moving the validation of bitstream_buffer into VDA implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compiling errors on windows Created 4 years, 10 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/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;

Powered by Google App Engine
This is Rietveld 408576698