[FFmpeg-cvslog] avcodec/dfa: Check the chunk header is not truncated
Michael Niedermayer
git at videolan.org
Fri May 10 22:03:08 EEST 2019
ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Mar 10 23:45:19 2019 +0100| [9e96567e14b4010d8e63186dccc89aee8784fe08] | committer: Michael Niedermayer
avcodec/dfa: Check the chunk header is not truncated
Fixes: Timeout (11sec -> 3sec)
Fixes: 13218/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DFA_fuzzer-5661074316066816
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit f20760fadbc77483b9ff4b400b53ebb38ee33793)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e96567e14b4010d8e63186dccc89aee8784fe08
---
libavcodec/dfa.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index b8500a4995..0cb5fe933e 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -353,6 +353,8 @@ static int dfa_decode_frame(AVCodecContext *avctx,
bytestream2_init(&gb, avpkt->data, avpkt->size);
while (bytestream2_get_bytes_left(&gb) > 0) {
+ if (bytestream2_get_bytes_left(&gb) < 12)
+ return AVERROR_INVALIDDATA;
bytestream2_skip(&gb, 4);
chunk_size = bytestream2_get_le32(&gb);
chunk_type = bytestream2_get_le32(&gb);
More information about the ffmpeg-cvslog
mailing list