In svq3 decoder, check negative mb_type, fix potential crash.
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Thu, 5 May 2011 01:45:36 +0000 (18:45 -0700)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 5 May 2011 22:30:03 +0000 (00:30 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/svq3.c

index 16f4834..7516606 100644 (file)
@@ -1049,7 +1049,7 @@ static int svq3_decode_frame(AVCodecContext *avctx,
             } else if (s->pict_type == AV_PICTURE_TYPE_B && mb_type >= 4) {
                 mb_type += 4;
             }
-            if (mb_type > 33 || svq3_decode_mb(svq3, mb_type)) {
+            if ((unsigned)mb_type > 33 || svq3_decode_mb(svq3, mb_type)) {
                 av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding MB %d %d\n", s->mb_x, s->mb_y);
                 return -1;
             }