Commit 1ba84845 authored by Michael Niedermayer's avatar 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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6d96bae9
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment