[FFmpeg-cvslog] avformat/thp: Check fps
Michael Niedermayer
git at videolan.org
Sun Jul 5 20:51:13 EEST 2020
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun 8 09:28:55 2020 +0200| [f46d3383413e004977c46032bd6e2295b8d2fa61] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 0e15b01b4e463d12128db2c15de7741637548347)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f46d3383413e004977c46032bd6e2295b8d2fa61
---
libavformat/thp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/thp.c b/libavformat/thp.c
index da2e56e14c..efe88b6f42 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);
More information about the ffmpeg-cvslog
mailing list