]> git.sesse.net Git - ffmpeg/commitdiff
avformat/movenc: handle tracks w/o AVStreams in calculate_mpeg4_bit_rates
authorJan Ekström <jeebjp@gmail.com>
Mon, 28 Sep 2020 14:23:07 +0000 (17:23 +0300)
committerJan Ekström <jeebjp@gmail.com>
Fri, 2 Oct 2020 13:49:44 +0000 (16:49 +0300)
The generated text streams for chapters lack an AVStream since they
are but an internal concept within movenc.

Fixes #8910

libavformat/movenc.c

index 265465f97b8c223dc279daadbaf1ce02041f6062..6c641d549db73b2b33855d132a5d6ffde91e0954 100644 (file)
@@ -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);