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 4934b28a58 avformat/sbgdec: fix float cast overflow
4934b28a58 is described below
commit 4934b28a58f55e254cb89d464bbfcff56d657eb3
Author: Marvin Scholz <[email protected]>
AuthorDate: Thu Oct 29 22:02:19 2026 +0000
Commit: Marvin Scholz <[email protected]>
CommitDate: Tue Nov 17 03:42:07 2026 +0000
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]>
---
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]