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

Unified Diff: content/common/gpu/media/dxva_video_decode_accelerator_win.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: Ready for review 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/dxva_video_decode_accelerator_win.cc
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
index a2f28f23374aaae70f7f3f3bbad64cae77ef1b65..caf1083e4f66adb93e741aeb659558714a708e24 100644
--- a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
+++ b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
@@ -947,6 +947,14 @@ void DXVAVideoDecodeAccelerator::Decode(
state == kFlushing),
"Invalid state: " << state, ILLEGAL_STATE,);
Pawel Osciak 2016/02/19 07:48:44 Perhaps we could just create SharedMemory here and
Owen Lin 2016/02/23 09:06:38 Done.
+ if (bitstream_buffer.id() < 0) {
+ if (base::SharedMemory::IsHandleValid(bitstream_buffer.handle()))
+ base::SharedMemory::CloseHandle(bitstream_buffer.handle());
+ RETURN_AND_NOTIFY_ON_FAILURE(
+ false, "Invalid bitstream_buffer, id: " << bitstream_buffer.id(),
+ INVALID_ARGUMENT, );
+ }
+
base::win::ScopedComPtr<IMFSample> sample;
sample.Attach(CreateSampleFromInputBuffer(bitstream_buffer,
input_stream_info_.cbSize,

Powered by Google App Engine
This is Rietveld 408576698