ffmpeg | branch: release/2.8 | Michael Niedermayer <[email protected]> | 
Sun May 31 14:24:04 2020 +0200| [2d29c017667ec721b886d89f2e5c6c02d647b00c] | 
committer: Michael Niedermayer

avformat/thp: Check compcount

Fixes: out of array access
Fixes: 
22520/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5100297658826752

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 1ba8484559661dfdbca36dbc17b203f33f62e26c)
Signed-off-by: Michael Niedermayer <[email protected]>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d29c017667ec721b886d89f2e5c6c02d647b00c
---

 libavformat/thp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/thp.c b/libavformat/thp.c
index 16fa327002..da2e56e14c 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -93,6 +93,9 @@ static int thp_read_header(AVFormatContext *s)
     avio_seek (pb, thp->compoff, SEEK_SET);
     thp->compcount       = avio_rb32(pb);
 
+    if (thp->compcount > FF_ARRAY_ELEMS(thp->components))
+        return AVERROR_INVALIDDATA;
+
     /* Read the list of component types.  */
     avio_read(pb, thp->components, 16);
 

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to