[FFmpeg-cvslog] avformat/movenc: handle tracks w/o AVStreams in calculate_mpeg4_bit_rates

Jan Ekström git at videolan.org
Fri Oct 2 18:42:56 EEST 2020


ffmpeg | branch: master | Jan Ekström <jeebjp at gmail.com> | Mon Sep 28 17:23:07 2020 +0300| [d9e812797c84be0f03aa1e95905da1f2cb2ed81e] | committer: Jan Ekström

avformat/movenc: handle tracks w/o AVStreams in calculate_mpeg4_bit_rates

The generated text streams for chapters lack an AVStream since they
are but an internal concept within movenc.

Fixes #8910

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d9e812797c84be0f03aa1e95905da1f2cb2ed81e
---

 libavformat/movenc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 265465f97b..6c641d549d 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -641,10 +641,11 @@ struct mpeg4_bit_rate_values {
 
 static struct mpeg4_bit_rate_values calculate_mpeg4_bit_rates(MOVTrack *track)
 {
-    AVCPBProperties *props =
+    AVCPBProperties *props = track->st ?
         (AVCPBProperties*)av_stream_get_side_data(track->st,
                                                   AV_PKT_DATA_CPB_PROPERTIES,
-                                                  NULL);
+                                                  NULL) :
+        NULL;
     struct mpeg4_bit_rate_values bit_rates = { 0 };
 
     bit_rates.avg_bit_rate = compute_avg_bitrate(track);



More information about the ffmpeg-cvslog mailing list