diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-01-11 23:26:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-03-27 13:37:19 +0200 |
commit | ebdeef043a164f70d7299a21769be090ba34f760 (patch) | |
tree | 78e93a6aed03fafa2f036717957fd8a54bfcedab /libavcodec | |
parent | 520af24c777379c4c7a008a9b34ff3e4cf8a96bf (diff) | |
download | ffmpeg-ebdeef043a164f70d7299a21769be090ba34f760.tar.gz |
avcodec/pngdec: Check deloco index more exactly
Fixes: out of array access:
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PNG_fuzzer-6716193709096960
Alternatively it should be possible to limit this to 3 plane RGB 8 /16bit to ensure the size is what it should be
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 d5bae704068dc37191280e024eecb8d02b762b28)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pngdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 3c00007907..0bd2dbfca2 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -322,7 +322,7 @@ void ff_png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type, static void deloco_ ## NAME(TYPE *dst, int size, int alpha) \ { \ int i; \ - for (i = 0; i < size; i += 3 + alpha) { \ + for (i = 0; i < size - 2; i += 3 + alpha) { \ int g = dst [i + 1]; \ dst[i + 0] += g; \ dst[i + 2] += g; \ |