diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-06-08 09:28:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-05 01:47:56 +0200 |
commit | 4f92e48d5c45c493f4214bf98577c5f03d6180f5 (patch) | |
tree | 7e353b595067f18f6e6dc30a9ad7796926f7a54a | |
parent | 374a18fbc81094f4f3a19d1ec56c33dbf835251b (diff) | |
download | ffmpeg-4f92e48d5c45c493f4214bf98577c5f03d6180f5.tar.gz |
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 0e15b01b4e463d12128db2c15de7741637548347)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/thp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/thp.c b/libavformat/thp.c index 2e27f1da18..fd5a60e30f 100644 --- a/libavformat/thp.c +++ b/libavformat/thp.c @@ -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); |