ffmpeg | branch: release/5.1 | Michael Niedermayer <mich...@niedermayer.cc> | 
Sun Feb 25 23:11:40 2024 +0100| [343757e6928a9884294e145d618faca5dc545bfe] | 
committer: Michael Niedermayer

avformat/concatdec: Check in and outpoints to be to produce a positive 
representable duration

Fixes: signed integer overflow: -93000000 - 9223372036839000000 cannot be 
represented in type 'long'
Fixes: 
64546/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-5110813828186112

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit b2d7cbc378fa276d62fd676c037b9df59fc319a0)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=343757e6928a9884294e145d618faca5dc545bfe
---

 libavformat/concatdec.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 806b570cdf..8bd0c5c5af 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -637,6 +637,12 @@ static int concat_parse_script(AVFormatContext *avf)
         }
     }
 
+    if (file->inpoint != AV_NOPTS_VALUE && file->outpoint != AV_NOPTS_VALUE) {
+        if (file->inpoint  > file->outpoint ||
+            file->outpoint - (uint64_t)file->inpoint > INT64_MAX)
+            ret = AVERROR_INVALIDDATA;
+    }
+
 fail:
     for (arg = 0; arg < MAX_ARGS; arg++)
         av_freep(&arg_str[arg]);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to