[FFmpeg-devel] [PATCH 1/4] avformat/apngdec: Check for incomplete reads in append_extradata()
Michael Niedermayer
michael at niedermayer.cc
Thu Oct 29 00:56:40 EET 2020
Fixes: OOM
Fixes: 26608/clusterfuzz-testcase-minimized-ffmpeg_dem_APNG_fuzzer-4839491644424192
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavformat/apngdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 0f1d04a365..2e79fdd85c 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -140,6 +140,8 @@ static int append_extradata(AVCodecParameters *par, AVIOContext *pb, int len)
if ((ret = avio_read(pb, par->extradata + previous_size, len)) < 0)
return ret;
+ if (ret < len)
+ return AVERROR_INVALIDDATA;
return previous_size;
}
--
2.17.1
More information about the ffmpeg-devel
mailing list