]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/faxcompr.c
Merge commit 'e7d7cf86dcaba8eaaed62c80172ff0aff2588c2a'
[ffmpeg] / libavcodec / faxcompr.c
index 80df418a2910c2601969fe5f3c6abafdc9480284..2a1d2bc3f6ca1365c65696a1ca977ed08dbd1356 100644 (file)
@@ -189,6 +189,10 @@ static int decode_uncompressed(AVCodecContext *avctx, GetBitContext *gb,
     *mode = !*mode;
     if (newmode != *mode) { //FIXME CHECK
         *(*runs)++ = 0;
+        if (*runs >= runend) {
+            av_log(avctx, AV_LOG_ERROR, "uncompressed run overrun\n");
+            return AVERROR_INVALIDDATA;
+        }
         *mode = newmode;
     }
     return 0;