[FFmpeg-devel] [PATCH] In svq3 decoder, check negative mb_type, fix potential crash.

Baptiste Coudurier baptiste.coudurier at gmail.com
Thu May 5 03:45:36 CEST 2011


---
 libavcodec/svq3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index f206634..39a3a64 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -1056,7 +1056,7 @@ static int svq3_decode_frame(AVCodecContext *avctx,
             } else if (s->pict_type == FF_B_TYPE && 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;
             }
-- 
1.7.4.4



More information about the ffmpeg-devel mailing list