aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-02-09 02:21:34 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-02-09 02:21:34 +0000
commit960964f5a9ad9d8e90aaeae9130fe81e80ce4ddf (patch)
tree9d86e8a752e1afb9db8d65c27a88425133220e2c /libavcodec/mpeg12.c
parentf7a49547de2c26f858114d8fec634e6662389efb (diff)
downloadffmpeg-960964f5a9ad9d8e90aaeae9130fe81e80ce4ddf.tar.gz
fix segfault with lol-ffplay2.mpg (dunno if this is exploitable, probably not easily)
Originally committed as revision 7889 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index c0d1f0d7b7..0b7cb47e80 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2593,6 +2593,10 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
break;
}
}
+ if(s->mb_x >= (unsigned)s->mb_width){
+ av_log(s->avctx, AV_LOG_ERROR, "initial skip overflow\n");
+ return -1;
+ }
s->resync_mb_x= s->mb_x;
s->resync_mb_y= s->mb_y= mb_y;