diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-01-08 20:03:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-06-04 20:18:13 +0200 |
commit | 879521ecdc9755622e63b4df35b7e11b517ed149 (patch) | |
tree | 432fed134c78285458a6c7e92438402d02fceb62 /libavcodec | |
parent | 4f9152af7784dae22dd4651e5216fa93ae111fc3 (diff) | |
download | ffmpeg-879521ecdc9755622e63b4df35b7e11b517ed149.tar.gz |
avcodec/scpr: Test bx before use
Fixes: out of array access on 32bit
Fixes: 54850/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5302669294305280
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 1b59de3770b2e3f7f44ec4adba27c88b79adaaec)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/scpr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index 1ec1b6d583..36011c822c 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -583,6 +583,9 @@ static int decompress_p(AVCodecContext *avctx, int run, r, g, b, z, bx = x * 16 + sx1, by = y * 16 + sy1; unsigned clr, ptype = 0; + if (bx >= avctx->width) + return AVERROR_INVALIDDATA; + for (; by < y * 16 + sy2 && by < avctx->height;) { ret = decode_value(s, s->op_model[ptype], 6, 1000, &ptype); if (ret < 0) |