4xm: reject frames not compatible with the declared version
authorLuca Barbato <lu_zero@gentoo.org>
Thu, 6 Jun 2013 14:58:57 +0000 (16:58 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 16 Jun 2013 13:54:06 +0000 (15:54 +0200)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 145023f57262d21474e35b4a6069cf95136339d4)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/4xm.c

index 4973b41..dbf4917 100644 (file)
@@ -835,6 +835,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
                 av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n",
                        id, avctx->frame_number);
 
+            if (f->version <= 1)
+                return AVERROR_INVALIDDATA;
+
             cfrm->size = cfrm->id = 0;
             frame_4cc  = AV_RL32("pfrm");
         } else