summaryrefslogtreecommitdiff
path: root/libavcodec/cpia.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-21 22:59:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-06-29 19:36:36 +0200
commitcea05864e65db9a2dc8af82b2c63fb8f03c5f876 (patch)
tree0cf425ecb3b4c6170be1c32295d8c66c7bab70cd /libavcodec/cpia.c
parent18b0dd07384b2987f24a4d0ba7600fde2787472a (diff)
downloadffmpeg-cea05864e65db9a2dc8af82b2c63fb8f03c5f876.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>
Diffstat (limited to 'libavcodec/cpia.c')
-rw-r--r--libavcodec/cpia.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c
index d88bd1aae7..a2ae16ec2c 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) {
frame->decode_error_flags = FF_DECODE_ERROR_INVALID_BITSTREAM;