This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 629a5b4b0f fftools: reject negative -t durations
629a5b4b0f is described below

commit 629a5b4b0fcc0e574e4c35068d81445ec399df37
Author:     张永鹏 <[email protected]>
AuthorDate: Thu Jul 16 20:30:29 2026 +0800
Commit:     Romain Beauxis <[email protected]>
CommitDate: Sat Jul 18 12:04:01 2026 -0500

    fftools: reject negative -t durations
    
    Reject negative recording durations for input and output -t before they 
reach streamcopy or trim handling. Keep -t 0 accepted.
    
    Signed-off-by: 张永鹏 <[email protected]>
---
 fftools/ffmpeg_demux.c    |  5 +++++
 fftools/ffmpeg_mux_init.c |  5 +++++
 tests/fate/ffmpeg.mak     | 14 ++++++++++++++
 3 files changed, 24 insertions(+)

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 8a165faf1d..0d8ccf21ee 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -2289,6 +2289,11 @@ int ifile_open(const OptionsContext *o, const char 
*filename, Scheduler *sch)
         }
     }
 
+    if (recording_time != INT64_MAX && recording_time < 0) {
+        av_log(d, AV_LOG_ERROR, "-t value must be non-negative; aborting.\n");
+        return AVERROR(EINVAL);
+    }
+
     if (o->format) {
         if (!(file_iformat = av_find_input_format(o->format))) {
             av_log(d, AV_LOG_FATAL, "Unknown input format: '%s'\n", o->format);
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index ca118dd3c5..79fde4d7ab 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -3492,6 +3492,11 @@ int of_open(const OptionsContext *o, const char 
*filename, Scheduler *sch)
         }
     }
 
+    if (recording_time != INT64_MAX && recording_time < 0) {
+        av_log(mux, AV_LOG_ERROR, "-t value must be non-negative; 
aborting.\n");
+        return AVERROR(EINVAL);
+    }
+
     of->recording_time = recording_time;
     of->start_time     = o->start_time;
 
diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index db6a171898..55c9ceb6bd 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -267,6 +267,20 @@ fate-ffmpeg-streamcopy-t: CMD = ffmpeg
     -c copy -f null -t 1 -
 FATE_FFMPEG-$(call REMUX, RAWVIDEO, NULL_MUXER) += fate-ffmpeg-streamcopy-t
 
+fate-ffmpeg-negative-t: tests/data/vsynth1.yuv
+fate-ffmpeg-negative-t: CMP = null
+fate-ffmpeg-negative-t: CMD = ffmpeg                                           
                    \
+    -stream_loop -1 -f rawvideo -s 352x288 -pix_fmt yuv420p -i 
$(TARGET_PATH)/tests/data/vsynth1.yuv \
+    -c copy -f null -t -1 -; test $$? -ne 0
+FATE_FFMPEG-$(call REMUX, RAWVIDEO, NULL_MUXER) += fate-ffmpeg-negative-t
+
+fate-ffmpeg-negative-input-t: tests/data/vsynth1.yuv
+fate-ffmpeg-negative-input-t: CMP = null
+fate-ffmpeg-negative-input-t: CMD = ffmpeg                                     
                   \
+    -stream_loop -1 -f rawvideo -s 352x288 -pix_fmt yuv420p -t -1 -i 
$(TARGET_PATH)/tests/data/vsynth1.yuv \
+    -c copy -f null -; test $$? -ne 0
+FATE_FFMPEG-$(call REMUX, RAWVIDEO, NULL_MUXER) += fate-ffmpeg-negative-input-t
+
 # Test loopback decoding and passing the output to a complex graph.
 fate-ffmpeg-loopback-decoding: tests/data/vsynth1.yuv
 fate-ffmpeg-loopback-decoding: CMD = transcode \

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to