summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 02:35:42 +0000
committerlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 02:35:42 +0000
commitc71ed509ee5d05f3e947fdecd8d2c3b97a0cf581 (patch)
tree83ad51f2906545113ba46fa5331adf4fc8c64b30
parent6f93fe801fed4a0877b411213c14344a13ab7e05 (diff)
downloadchromium_src-c71ed509ee5d05f3e947fdecd8d2c3b97a0cf581.zip
chromium_src-c71ed509ee5d05f3e947fdecd8d2c3b97a0cf581.tar.gz
chromium_src-c71ed509ee5d05f3e947fdecd8d2c3b97a0cf581.tar.bz2
Merge 32455 - Check for null frame pointers and do nothing to avoid a crash.
BUG=27675 TEST=play this http://fbarchardkir.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 TBR=fbarchard@chromium.org Review URL: http://codereview.chromium.org/405028 git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@32475 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--media/filters/ffmpeg_video_decoder.cc9
1 files changed, 9 insertions, 0 deletions
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<VideoFrame> video_frame;
VideoFrameImpl::CreateFrame(surface_format, width_, height_,
time.timestamp, time.duration, &video_frame);