mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/thp: Check fps
Fixes: division by zero
Fixes: 23162/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4856420817436672
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 0e15b01b4e
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
38af60a454
commit
d31345a880
@ -75,6 +75,8 @@ static int thp_read_header(AVFormatContext *s)
|
||||
avio_rb32(pb); /* Max samples. */
|
||||
|
||||
thp->fps = av_d2q(av_int2float(avio_rb32(pb)), INT_MAX);
|
||||
if (thp->fps.den <= 0 || thp->fps.num < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
thp->framecnt = avio_rb32(pb);
|
||||
thp->first_framesz = avio_rb32(pb);
|
||||
pb->maxsize = avio_rb32(pb);
|
||||
|
Loading…
Reference in New Issue
Block a user