Skip to content

Commit

Permalink
avcodec/scpr3: Check bx
Browse files Browse the repository at this point in the history
Fixes: Out of array access
Fixes: 55102/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-4877396618903552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit cc7e984)
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 15, 2023
1 parent 79d4034 commit b353459
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavcodec/scpr3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,9 @@ static int decompress_p3(AVCodecContext *avctx,
int run, bx = x * 16 + sx1, by = y * 16 + sy1;
uint32_t clr, ptype = 0, r, g, b;

if (bx >= avctx->width)
return AVERROR_INVALIDDATA;

for (; by < y * 16 + sy2 && by < avctx->height;) {
ret = decode_value3(s, 5, &s->op_model3[ptype].cntsum,
s->op_model3[ptype].freqs[0],
Expand Down

0 comments on commit b353459

Please sign in to comment.