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 a955f5217aa6f6430636da28961741c1d6c6a77b Author: Marvin Scholz <[email protected]> AuthorDate: Fri Oct 23 14:29:58 2026 +0000 Commit: Michael Niedermayer <[email protected]> CommitDate: Thu Nov 19 14:56:30 2026 +0100 avformat/flvdec: prevent float-cast-overflow in amf_parse_object Validate duration, videodatarate, and audiodatarate in amf_parse_object() before converting double values to int64_t, preventing float-cast-overflow undefined behavior on NaN, negative, infinite, or out-of-range values. Signed-off-by: Marvin Scholz <[email protected]> (cherry picked from commit 3cbb3a035e5ede179c5abd700c6bd7b17c02d4ce) Signed-off-by: Michael Niedermayer <[email protected]> --- libavformat/flvdec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 1e52971ac3..5e742c8dec 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -719,13 +719,14 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, if (depth == 1) { if (amf_type == AMF_DATA_TYPE_NUMBER || amf_type == AMF_DATA_TYPE_BOOL) { - if (!strcmp(key, "duration")) + if (!strcmp(key, "duration") && + num_val >= 0 && num_val < INT64_MAX / AV_TIME_BASE) s->duration = num_val * AV_TIME_BASE; else if (!strcmp(key, "videodatarate") && - 0 <= (int)(num_val * 1024.0)) + 0 <= num_val && num_val < INT_MAX / 1024.0) flv->video_bit_rate = num_val * 1024.0; else if (!strcmp(key, "audiodatarate") && - 0 <= (int)(num_val * 1024.0)) + 0 <= num_val && num_val < INT_MAX / 1024.0) flv->audio_bit_rate = num_val * 1024.0; else if (!strcmp(key, "framerate")) { flv->framerate = av_d2q(num_val, 1000); -- 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]
