Browse Source

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: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d4a731b84a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.8.2
Michael Niedermayer 10 years ago
parent
commit
a7bbb7fb88
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/faxcompr.c

+ 4
- 0
libavcodec/faxcompr.c View 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;


Loading…
Cancel
Save