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

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

Issue 1476523005: Verify returned frames from media::VideoFrame::Wrap*() methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: halliwell@ comments. Created 4 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
Index: content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
diff --git a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
index 1082b5c9c1a5cb25258309deafa38b22b575ad48..7408e46d9272e9ca2b726903b19913f8c595a327 100644
--- a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
@@ -248,9 +248,6 @@ class GpuJpegDecodeAccelerator::MessageFilter : public IPC::MessageFilter {
params.output_video_frame_handle, // handle
0, // data_offset
base::TimeDelta()); // timestamp
- frame->AddDestructionObserver(
- base::Bind(DecodeFinished, base::Passed(&output_shm)));
-
if (!frame.get()) {
LOG(ERROR) << "Could not create VideoFrame for input buffer id "
<< params.input_buffer_id;
@@ -260,6 +257,8 @@ class GpuJpegDecodeAccelerator::MessageFilter : public IPC::MessageFilter {
base::SharedMemory::CloseHandle(params.input_buffer_handle);
return;
}
+ frame->AddDestructionObserver(
+ base::Bind(DecodeFinished, base::Passed(&output_shm)));
DCHECK_GT(client_map_.count(*route_id), 0u);
Client* client = client_map_[*route_id];

Powered by Google App Engine
This is Rietveld 408576698