X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ffaxcompr.c;h=2a1d2bc3f6ca1365c65696a1ca977ed08dbd1356;hb=24563c20f181cb9d7015e9595d9cb6846cf02dfa;hp=80df418a2910c2601969fe5f3c6abafdc9480284;hpb=564eabeebb1e4239d0ff19a5a93ff9757ebbec70;p=ffmpeg diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c index 80df418a291..2a1d2bc3f6c 100644 --- a/libavcodec/faxcompr.c +++ b/libavcodec/faxcompr.c @@ -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;