aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-02-14 20:01:35 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-03-28 22:18:12 +0200
commit97a21e9373f2b9ddd6f66adbcd2b31848ab8fab8 (patch)
tree2341cb44f477fa9ffd8722a1e3d29d447e67e187
parenta865deaa393e2fa3029192a1d2becb7368ab9b6b (diff)
downloadffmpeg-97a21e9373f2b9ddd6f66adbcd2b31848ab8fab8.tar.gz
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@outlook.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 36680078ca3302496d9b0b8a8d7168ce9eabb2bc) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 937ba3e026..a262d29cda 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2186,6 +2186,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;