Index: media/filters/vpx_video_decoder.cc |
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc |
index d9721b0c9474e6aa83867d395d8dbad900473aaf..8a44c16ec1f1f20cfadff460bf25f6376e0d4677 100644 |
--- a/media/filters/vpx_video_decoder.cc |
+++ b/media/filters/vpx_video_decoder.cc |
@@ -464,6 +464,10 @@ bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer, |
} |
CopyVpxImageToVideoFrame(vpx_image, video_frame); |
+ if (!video_frame->get()) { |
+ DLOG(ERROR) << "Couldn't create video frame"; |
+ return false; |
+ } |
(*video_frame)->set_timestamp(base::TimeDelta::FromMicroseconds(timestamp)); |
// Default to the color space from the config, but if the bistream specifies |
@@ -576,8 +580,9 @@ void 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)); |
UMA_HISTOGRAM_COUNTS("Media.Vpx.VideoDecoderBuffersInUseByDecoder", |
memory_pool_->NumberOfFrameBuffersInUseByDecoder()); |