summaryrefslogtreecommitdiff
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-04-09 20:13:35 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-04-09 20:13:35 +0000
commit69409ccb801939f4b09f16946a236d10e18f7005 (patch)
tree44783112e6f9e80fb5c436d402e0405568b0b11a /libavcodec/snow.c
parent440882f7bec203e9255c9de87468df0fa867d9d1 (diff)
Skip non intra frames that have no reference frames.
Originally committed as revision 18395 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 501b60dde4..ffdf1ffd02 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -4145,6 +4145,10 @@ static int frame_start(SnowContext *s){
if(i && s->last_picture[i-1].key_frame)
break;
s->ref_frames= i;
+ if(s->ref_frames==0){
+ av_log(s->avctx,AV_LOG_ERROR, "No reference frames\n");
+ return -1;
+ }
}
s->current_picture.reference= 1;
@@ -4520,7 +4524,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
alloc_blocks(s);
- frame_start(s);
+ if(frame_start(s) < 0)
+ return -1;
//keyframe flag duplication mess FIXME
if(avctx->debug&FF_DEBUG_PICT_INFO)
av_log(avctx, AV_LOG_ERROR, "keyframe:%d qlog:%d\n", s->keyframe, s->qlog);