Skip to content
Permalink
Browse files Browse the repository at this point in the history
avcodec/scpr: Fix multiple runtime error: index 256 out of bounds for…
… type 'unsigned int [256]'

Fixes: 1519/clusterfuzz-testcase-minimized-5286680976162816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed May 13, 2017
1 parent 54e1b62 commit 2171dfa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavcodec/scpr.c
Expand Up @@ -261,6 +261,9 @@ static int decode_unit(SCPRContext *s, PixelModel *pixel, unsigned step, unsigne
break;
c++;
}
if (x >= 16 || c >= 256) {
return AVERROR_INVALIDDATA;
}

if ((ret = s->decode(gb, rc, cumfr, cnt_c, totfr)) < 0)
return ret;
Expand Down

0 comments on commit 2171dfa

Please sign in to comment.