This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/9.0 in repository ffmpeg.
commit 10b2f2c236370856eeed0cbbac0c63740b5cec5a Author: 张永鹏 <[email protected]> AuthorDate: Thu Jul 16 20:30:29 2026 +0800 Commit: Michael Niedermayer <[email protected]> CommitDate: Thu Sep 17 17:35:20 2026 +0200 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]> (cherry picked from commit 629a5b4b0fcc0e574e4c35068d81445ec399df37) Signed-off-by: Michael Niedermayer <[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 38bd580bfc..9d870bfb1a 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -2066,6 +2066,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 89106caa5d..e4bbaa44be 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -3318,6 +3318,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 cd00275638..e1a43df169 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 \ -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
