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

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

The following commit(s) were added to refs/heads/release/5.1 by this push:
     new 41e8a13c12 libavformat/dashenc.c: check if packets were muxed before 
calculating average bitrate
41e8a13c12 is described below

commit 41e8a13c124c44a4cd05018f6e0f27f9e7164cd8
Author:     Sergei Iashin <[email protected]>
AuthorDate: Wed Feb 17 22:12:13 2021 +0300
Commit:     James Almer <[email protected]>
CommitDate: Sun Sep 27 11:52:32 2026 -0300

    libavformat/dashenc.c: check if packets were muxed before calculating 
average bitrate
    
    Prevents SIGFPE.
    Fixes issue #24738.
    
    Signed-off-by: James Almer <[email protected]>
    (cherry picked from commit d62aef2e50434cc31eccf236ae67d864becb7068)
---
 libavformat/dashenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 295b01e225..ad3f422bc9 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -834,7 +834,9 @@ static int write_adaptation_set(AVFormatContext *s, 
AVIOContext *out, int as_ind
         if (os->bit_rate > 0)
             snprintf(bandwidth_str, sizeof(bandwidth_str), " 
bandwidth=\"%d\"", os->bit_rate);
         else if (final) {
-            int average_bit_rate = os->pos * 8 * AV_TIME_BASE / 
c->total_duration;
+            int average_bit_rate = 0;
+            if (c->total_duration > 0)
+                average_bit_rate = os->pos * 8 * AV_TIME_BASE / 
c->total_duration;
             snprintf(bandwidth_str, sizeof(bandwidth_str), " 
bandwidth=\"%d\"", average_bit_rate);
         } else if (os->first_segment_bit_rate > 0)
             snprintf(bandwidth_str, sizeof(bandwidth_str), " 
bandwidth=\"%d\"", os->first_segment_bit_rate);

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