This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/8.1 in repository ffmpeg.
commit da37798dfdf53afbacb563cab3e62a00bfa37055 Author: 张永鹏 <[email protected]> AuthorDate: Thu Jul 16 20:30:29 2026 +0800 Commit: Michael Niedermayer <[email protected]> CommitDate: Sat Sep 19 14:27:18 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 bec6886057..bea1db5ff3 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1929,6 +1929,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 09e241a0ff..35d3f10bb4 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -3377,6 +3377,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]
