diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-04-12 15:00:32 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-04-12 15:00:32 +0000 |
commit | 487bce53ebe2761a20e88837b8d903a30d370aa0 (patch) | |
tree | d522dae93bf0b740802650dd125289e1df5cb88b /libavcodec/h263dec.c | |
parent | 6692d61b120c5e1723476222cd349051f2a7c3de (diff) | |
download | ffmpeg-487bce53ebe2761a20e88837b8d903a30d370aa0.tar.gz |
10l (use before malloc)
Originally committed as revision 1768 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 75dbcb2d6c..98215bf4cd 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -643,14 +643,21 @@ retry: ff_er_frame_start(s); + //the second part of the wmv2 header contains the MB skip bits which are stored in current_picture->mb_type + //which isnt available before MPV_frame_start() + if (s->msmpeg4_version==5){ + if(ff_wmv2_decode_secondary_picture_header(s) < 0) + return -1; + } + /* decode each macroblock */ s->mb_x=0; s->mb_y=0; decode_slice(s); - while(s->mb_y<s->mb_height && s->gb.size_in_bits - get_bits_count(&s->gb)>16){ + while(s->mb_y<s->mb_height){ if(s->msmpeg4_version){ - if(s->mb_x!=0 || (s->mb_y%s->slice_height)!=0) + if(s->mb_x!=0 || (s->mb_y%s->slice_height)!=0 || get_bits_count(&s->gb) > s->gb.size_in_bits) break; }else{ if(ff_h263_resync(s)<0) @@ -733,7 +740,6 @@ retry: *pict= *(AVFrame*)&s->last_picture; ff_print_debug_info(s, s->last_picture_ptr); } - /* Return the Picture timestamp as the frame number */ /* we substract 1 because it is added on utils.c */ |