Chromium Code Reviews| Index: media/filters/vpx_video_decoder.cc |
| diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc |
| index 40814bb273ad5a3f5cc18e96ea9172f9fd4e929b..7d327cc229c8d622db245e723d1151e05b5af4fa 100644 |
| --- a/media/filters/vpx_video_decoder.cc |
| +++ b/media/filters/vpx_video_decoder.cc |
| @@ -592,8 +592,9 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame( |
| vpx_image->planes[VPX_PLANE_U], |
| vpx_image->planes[VPX_PLANE_V], |
| kNoTimestamp()); |
| - video_frame->get()->AddDestructionObserver( |
| - memory_pool_->CreateFrameCallback(vpx_image->fb_priv)); |
| + if (video_frame->get()) |
| + video_frame->get()->AddDestructionObserver( |
| + memory_pool_->CreateFrameCallback(vpx_image->fb_priv)); |
|
mcasas
2016/01/12 17:46:16
Needs {}
You can test if (video_frame) directly.
emircan
2016/01/14 23:07:40
Done.
|
| UMA_HISTOGRAM_COUNTS("Media.Vpx.VideoDecoderBuffersInUseByDecoder", |
| memory_pool_->NumberOfFrameBuffersInUseByDecoder()); |
| @@ -610,6 +611,8 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame( |
| *video_frame = frame_pool_.CreateFrame( |
| codec_format, visible_size, gfx::Rect(visible_size), |
| config_.natural_size(), kNoTimestamp()); |
| + if (!(*video_frame)) |
|
mcasas
2016/01/12 17:46:16
if (!video_frame) ?
emircan
2016/01/14 23:07:40
Done.
|
| + return false; |
| libyuv::I420Copy( |
| vpx_image->planes[VPX_PLANE_Y], vpx_image->stride[VPX_PLANE_Y], |