From 492ee7bbe69032c872ae5965e0850efdf91083ed Mon Sep 17 00:00:00 2001 From: "fbarchard@chromium.org" Date: Thu, 19 Nov 2009 00:59:14 +0000 Subject: Check for null frame pointers and do nothing to avoid a crash. BUG=27675 TEST=play this http://fbarchard-kir.ad.corp.google.com/mediatests/runthrough.mp4 and do lots of seeks. A crash will occur after about 5 or 10 seeks without this patch. Review URL: http://codereview.chromium.org/401021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32455 0039d316-1c4b-4281-b951-d872f2087c98 --- media/filters/ffmpeg_video_decoder.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'media') diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index bd3ed981..b2cb78c 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -195,6 +195,15 @@ void FFmpegVideoDecoder::OnDecode(Buffer* buffer) { bool FFmpegVideoDecoder::EnqueueVideoFrame(VideoSurface::Format surface_format, const TimeTuple& time, const AVFrame* frame) { + // TODO(fbarchard): Work around for FFmpeg http://crbug.com/27675 + // The decoder is in a bad state and not decoding correctly. + // Checking for NULL avoids a crash in CopyPlane(). + if (!frame->data[VideoSurface::kYPlane] || + !frame->data[VideoSurface::kUPlane] || + !frame->data[VideoSurface::kVPlane]) { + return true; + } + scoped_refptr video_frame; VideoFrameImpl::CreateFrame(surface_format, width_, height_, time.timestamp, time.duration, &video_frame); -- cgit v1.1