Message ID | 20200928170440.7779-1-jeebjp@gmail.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] avformat/movenc: exit calculate_mpeg4_bit_rates early if track lacks required values | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make_warn | warning | New warnings during build |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 20768cd45f..a17fa6757c 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -641,6 +641,12 @@ struct mpeg4_bit_rate_values { static struct mpeg4_bit_rate_values calculate_mpeg4_bit_rates(MOVTrack *track) { + if (!track->st || !track->par) + // if there is no AVStream or codecpar available for track, early exit + return (struct mpeg4_bit_rate_values) { + 0 + }; + AVCPBProperties *props = (AVCPBProperties*)av_stream_get_side_data(track->st, AV_PKT_DATA_CPB_PROPERTIES,