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

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit 7961b240b1f3229bf912f1c0e5bd37b4357a58b7
Author:     Marvin Scholz <[email protected]>
AuthorDate: Thu Oct 29 22:02:19 2026 +0000
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 19 14:56:30 2026 +0100

    avformat/sbgdec: fix float cast overflow
    
    When parsing crafted SBG scripts containing 'NAN', strtod() returns NaN.
    When scaled, m evaluates to NaN. Relational comparisons against NaN
    evaluate to false, so m bypassed the range validation and was cast to
    int, triggering undefined behavior (float-cast-overflow).
    
    Validate with isnan(m) to prevent NaN from being cast to integer.
    
    Signed-off-by: Marvin Scholz <[email protected]>
    (cherry picked from commit 4934b28a58f55e254cb89d464bbfcff56d657eb3)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/sbgdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c
index c1ba1dd408..93003bca56 100644
--- a/libavformat/sbgdec.c
+++ b/libavformat/sbgdec.c
@@ -217,9 +217,9 @@ static inline int is_space(char c)
 static inline int scale_double(void *log, double d, double m, int *r)
 {
     m *= d * SBG_SCALE;
-    if (m < INT_MIN || m >= INT_MAX) {
+    if (isnan(m) || m < INT_MIN || m >= INT_MAX) {
         if (log)
-            av_log(log, AV_LOG_ERROR, "%g is too large\n", d);
+            av_log(log, AV_LOG_ERROR, "%g is %s\n", d, isnan(m) ? "not a valid 
number" : "too large");
         return AVERROR(EDOM);
     }
     *r = m;

-- 
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]

Reply via email to