diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2006-07-23 18:22:29 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2006-07-23 18:22:29 +0000 |
commit | bc185f72c0ef515d1d077df5bad2fb1336f70d5e (patch) | |
tree | da728123b1e1d4c2a4ab124ea08162d813ccfc85 /libavcodec/vp3.c | |
parent | 22ffac707e52ce58c0bd71857fe1353f453f78e0 (diff) | |
download | ffmpeg-streaming-bc185f72c0ef515d1d077df5bad2fb1336f70d5e.zip ffmpeg-streaming-bc185f72c0ef515d1d077df5bad2fb1336f70d5e.tar.gz |
Do not crash when the first frame is not a keyframe (and thus none of the
necessary initialization has been done yet).
Originally committed as revision 5815 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r-- | libavcodec/vp3.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index eb9e917..b5cfbb0 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2235,10 +2235,15 @@ static int vp3_decode_frame(AVCodecContext *avctx, vp3_calculate_pixel_addresses(s); else theora_calculate_pixel_addresses(s); + s->pixel_addresses_inited = 1; } } else { /* allocate a new current frame */ s->current_frame.reference = 3; + if (!s->pixel_addresses_inited) { + av_log(s->avctx, AV_LOG_ERROR, "vp3: first frame not a keyframe\n"); + return -1; + } if(avctx->get_buffer(avctx, &s->current_frame) < 0) { av_log(s->avctx, AV_LOG_ERROR, "vp3: get_buffer() failed\n"); return -1; |