diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-08-01 11:00:03 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-08-01 11:00:03 +0000 |
commit | ffba1dc02b3c808dcf023351a0ed5dcca3fc1513 (patch) | |
tree | 24354fc10db44d8c98de0949c6b3ea817e13dfe9 /libavcodec/mpegvideo.c | |
parent | e7d0374f2763a95965750c442bfb690387150321 (diff) | |
download | ffmpeg-ffba1dc02b3c808dcf023351a0ed5dcca3fc1513.tar.gz |
make the h263 decoder more error tolerant
Originally committed as revision 2099 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 6a3b5c7185..f7525bffd0 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1004,6 +1004,14 @@ alloc: if(s->next_picture_ptr) s->next_picture= *s->next_picture_ptr; if(s->new_picture_ptr ) s->new_picture = *s->new_picture_ptr; + if(s->pict_type != I_TYPE && s->last_picture_ptr==NULL){ + fprintf(stderr, "warning: first frame is no keyframe\n"); + assert(s->pict_type != B_TYPE); //these should have been dropped if we dont have a reference + goto alloc; + } + + assert(s->pict_type == I_TYPE || (s->last_picture_ptr && s->last_picture_ptr->data[0])); + if(s->picture_structure!=PICT_FRAME){ int i; for(i=0; i<4; i++){ @@ -1015,12 +1023,6 @@ alloc: s->next_picture.linesize[i] *=2; } } - - if(s->pict_type != I_TYPE && s->last_picture_ptr==NULL){ - fprintf(stderr, "warning: first frame is no keyframe\n"); - assert(s->pict_type != B_TYPE); //these should have been dropped if we dont have a reference - goto alloc; - } } s->hurry_up= s->avctx->hurry_up; |