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..c853d01161cd37195f070bb75f8399357858dbc3 100644 |
--- a/media/filters/vpx_video_decoder.cc |
+++ b/media/filters/vpx_video_decoder.cc |
@@ -576,8 +576,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()); |
@@ -594,18 +595,19 @@ void VpxVideoDecoder::CopyVpxImageToVideoFrame( |
*video_frame = frame_pool_.CreateFrame( |
codec_format, visible_size, gfx::Rect(visible_size), |
config_.natural_size(), kNoTimestamp()); |
- |
- libyuv::I420Copy( |
- vpx_image->planes[VPX_PLANE_Y], vpx_image->stride[VPX_PLANE_Y], |
- vpx_image->planes[VPX_PLANE_U], vpx_image->stride[VPX_PLANE_U], |
- vpx_image->planes[VPX_PLANE_V], vpx_image->stride[VPX_PLANE_V], |
- (*video_frame)->visible_data(VideoFrame::kYPlane), |
- (*video_frame)->stride(VideoFrame::kYPlane), |
- (*video_frame)->visible_data(VideoFrame::kUPlane), |
- (*video_frame)->stride(VideoFrame::kUPlane), |
- (*video_frame)->visible_data(VideoFrame::kVPlane), |
- (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), |
- coded_size.height()); |
+ if (*video_frame) { |
+ libyuv::I420Copy( |
+ vpx_image->planes[VPX_PLANE_Y], vpx_image->stride[VPX_PLANE_Y], |
+ vpx_image->planes[VPX_PLANE_U], vpx_image->stride[VPX_PLANE_U], |
+ vpx_image->planes[VPX_PLANE_V], vpx_image->stride[VPX_PLANE_V], |
+ (*video_frame)->visible_data(VideoFrame::kYPlane), |
+ (*video_frame)->stride(VideoFrame::kYPlane), |
+ (*video_frame)->visible_data(VideoFrame::kUPlane), |
+ (*video_frame)->stride(VideoFrame::kUPlane), |
+ (*video_frame)->visible_data(VideoFrame::kVPlane), |
+ (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), |
+ coded_size.height()); |
+ } |
} |
} // namespace media |