[FFmpeg-cvslog] avformat/matroskadec: Check duration
Michael Niedermayer
git at videolan.org
Fri Apr 8 01:31:50 EEST 2022
ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb 14 20:01:35 2022 +0100| [084b4f82a37d0f065f98701214ede7d3cdff87f2] | committer: Michael Niedermayer
avformat/matroskadec: Check duration
Fixes: -nan is outside the range of representable values of type 'long'
Fixes: 44614/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6216204841254912
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 36680078ca3302496d9b0b8a8d7168ce9eabb2bc)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=084b4f82a37d0f065f98701214ede7d3cdff87f2
---
libavformat/matroskadec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 1607f94d48..565df66b49 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2892,6 +2892,8 @@ static int matroska_read_header(AVFormatContext *s)
if (!matroska->time_scale)
matroska->time_scale = 1000000;
+ if (isnan(matroska->duration))
+ matroska->duration = 0;
if (matroska->duration)
matroska->ctx->duration = matroska->duration * matroska->time_scale *
1000 / AV_TIME_BASE;
More information about the ffmpeg-cvslog
mailing list