mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-23 15:26:57 +00:00
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 <michael@niedermayer.cc>
(cherry picked from commit 1ba8484559
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0179add61d
commit
d28891ca8f
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user