aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-21 22:59:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-17 21:34:53 +0200
commit26cd140d0c03b08b611907ea23b120af29b3b927 (patch)
tree7df4e8608d411aa265b076e92b8a35f55ef5ddb0
parent39cf28ffd609b8879a0e2475c0b16647682cb5f5 (diff)
downloadffmpeg-26cd140d0c03b08b611907ea23b120af29b3b927.tar.gz
avcodec/cpia: Fix missing src_size update
Fixes: out of array read Fixes: 35210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CPIA_fuzzer-5669199688105984 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 cea05864e65db9a2dc8af82b2c63fb8f03c5f876) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/cpia.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c
index 72c5803db1..4b345c78d0 100644
--- a/libavcodec/cpia.c
+++ b/libavcodec/cpia.c
@@ -111,6 +111,7 @@ static int cpia_decode_frame(AVCodecContext *avctx,
// Read line length, two byte little endian
linelength = AV_RL16(src);
src += 2;
+ src_size -= 2;
if (src_size < linelength) {
av_frame_set_decode_error_flags(frame, FF_DECODE_ERROR_INVALID_BITSTREAM);