Commit d4a731b8 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/faxcompr: Add missing runs check in decode_uncompressed()

Fixes out of array access
Fixes: 54e488b9da4abbceaf405d6492515697/asan_heap-oob_32769b0_160_a8755eb08ee8f9579348501945a33955.TIF

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c9bfd6a8
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment