diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-01-16 00:01:13 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-03-27 13:37:17 +0200 |
commit | 15eaacfa5c1bd400f0f869816b0e55da80175d72 (patch) | |
tree | 534f3a80bb3b37b7568e6618722b5b441d4f9286 | |
parent | 9e9360e4c8b0e3ba90a358220f59404bd3d772a8 (diff) | |
download | ffmpeg-15eaacfa5c1bd400f0f869816b0e55da80175d72.tar.gz |
avcodec/scpr3: Check bx
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 <michael@niedermayer.cc>
(cherry picked from commit cc7e984a05b28dcfaaaad95afa061be71b4ba7fc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/scpr3.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/scpr3.c b/libavcodec/scpr3.c index 78c58889cb..274f99ce71 100644 --- a/libavcodec/scpr3.c +++ b/libavcodec/scpr3.c @@ -1168,6 +1168,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], |