diff mbox series

[FFmpeg-devel,11/25] avformat/mux: Don't access AVStream's internal AVCodecContext

Message ID AM7PR03MB6660E9CDD559ABBF633E698A8FC89@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit bafb65ba2ab15a6c05ca73b2b0a82e23f57c30c6
Headers show
Series [FFmpeg-devel,01/25] avformat/matroskadec: Fix heap-buffer overflow upon gigantic timestamps | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/configureppc warning Failed to apply patch

Commit Message

Andreas Rheinhardt Aug. 27, 2021, 2:27 p.m. UTC
An AVStream's internal AVCodecContext is pretty much unused for muxing:
The only place where any of its fields are set is
avformat_transfer_internal_stream_timing_info() where its time base is
set based upon the desired output format. The max_b_frames field is
never set at all, so don't read it in mux.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 6fa1c5495b..b1ad0dd561 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -509,7 +509,7 @@  FF_DISABLE_DEPRECATION_WARNINGS
 //FIXME merge with compute_pkt_fields
 static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket *pkt)
 {
-    int delay = FFMAX(st->codecpar->video_delay, st->internal->avctx->max_b_frames > 0);
+    int delay = st->codecpar->video_delay;
     int i;
     int frame_size;