This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit cce86fe6573704009bb8ccc777e810b5fd2e7008 Author: Michael Niedermayer <[email protected]> AuthorDate: Sat Nov 7 00:33:33 2026 +0100 Commit: michaelni <[email protected]> CommitDate: Tue Nov 17 17:54:46 2026 +0000 avfilter/setpts: avoid undefined behavior with double to int64 cast Fixes: inf is outside the range of representable values of type 'long' Fixes: nw59dSqw4SNa Found-by: Mindaugas Rukas <[email protected]> This is not a security issue. Out of range conversion Replicated through UnModified FFmpeg with UBSAN --- libavfilter/filters.h | 2 +- libavfilter/setpts.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/filters.h b/libavfilter/filters.h index 2df05a727a..4b2a5564c1 100644 --- a/libavfilter/filters.h +++ b/libavfilter/filters.h @@ -493,7 +493,7 @@ static inline const FFFilter *fffilter(const AVFilter *f) #define AVFILTER_DEFINE_CLASS(fname) \ AVFILTER_DEFINE_CLASS_EXT(fname, #fname, fname##_options) -#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d)) +#define D2TS(d) ((d) >= INT64_MIN && (d) < (double)INT64_MAX ? (int64_t)(d) : AV_NOPTS_VALUE) #define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb)) diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c index 5648a9ffae..ed176a25e7 100644 --- a/libavfilter/setpts.c +++ b/libavfilter/setpts.c @@ -161,7 +161,7 @@ static int config_output_video(AVFilterLink *outlink) static inline char *double2int64str(char *buf, double v) { if (isnan(v)) snprintf(buf, BUF_SIZE, "nan"); - else snprintf(buf, BUF_SIZE, "%"PRId64, (int64_t)v); + else snprintf(buf, BUF_SIZE, "%"PRId64, D2TS(v)); return buf; } -- 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]
