Chromium Code Reviews| Index: media/filters/gpu_video_decoder.cc |
| diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc |
| index 16a33eae54c6fc3cdff4f65b09e773af14392a01..b02b3fd090a39c8eba97e4998be27252a5990e19 100644 |
| --- a/media/filters/gpu_video_decoder.cc |
| +++ b/media/filters/gpu_video_decoder.cc |
| @@ -422,8 +422,20 @@ void GpuVideoDecoder::PictureReady(const media::Picture& picture) { |
| } |
| const PictureBuffer& pb = it->second; |
| + // Validate picture size from GPU |
| + if (picture.size().IsEmpty() || |
| + !gfx::Rect(pb.size()).Contains(gfx::Rect(picture.size()))) { |
| + LOG(ERROR) << "Invalid picture size from VDA: " << picture.size().ToString() |
|
ddorwin
2014/08/18 16:26:38
Do we need this string in opt builds?
kcwu
2014/08/18 17:33:06
Done.
|
| + << " should fit in " << pb.size().ToString(); |
| + NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| + return; |
| + } |
| + |
| // Update frame's timestamp. |
| base::TimeDelta timestamp; |
| + // Some of the VDAs don't support and thus don't provide us with visible |
|
ddorwin
2014/08/18 16:26:38
Does this comment mean we are handling such VDAs d
kcwu
2014/08/18 17:33:06
Always doing this. The other consideration is GpuV
|
| + // size in picture.size, passing coded size instead, so drop it and use |
| + // config information instead. |
| gfx::Rect visible_rect; |
| gfx::Size natural_size; |
| GetBufferData(picture.bitstream_buffer_id(), ×tamp, &visible_rect, |