summaryrefslogtreecommitdiff
path: root/libavcodec/msmpeg4.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-08-04 19:28:27 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-08-04 19:28:27 +0000
commit159d10fc2c72d1c4e7e2c8161810965505a0ad61 (patch)
tree2ef0d922054276826fe714848cf8bae5dbfcb417 /libavcodec/msmpeg4.c
parent0a6baf39cb426226ec23147f536ad9511336c64a (diff)
downloadffmpeg-159d10fc2c72d1c4e7e2c8161810965505a0ad61.tar.gz
hopefully fixing unreprodceable segfault when overreading the end if error_resilience==-1 (it didnt overread here though)
Originally committed as revision 841 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msmpeg4.c')
-rw-r--r--libavcodec/msmpeg4.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 74c16994e5..1c53b8d0d1 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -1859,7 +1859,8 @@ static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
if (i > 62){
i-= 192;
if(i&(~63)){
- if((i+192 == 64 && level/qmul==-1) || s->error_resilience<0){
+ const int left= s->gb.size*8 - get_bits_count(&s->gb);
+ if(((i+192 == 64 && level/qmul==-1) || s->error_resilience<0) && left>=0){
fprintf(stderr, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y);
break;
}else{