From dc953a19e6bf6b3feb765ecfbffc654aefa4e8f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Wed, 24 Jun 2026 03:32:54 +0200 Subject: [PATCH] avformat/hlsenc: initialize avg_bandwidth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes use of uninitialized value and dumping it into AVERAGE-BANDWIDTH in playlist. Note this will be correctly set when we are at final segment, otherwise it's optional. Fixes: fate-hls-seek test on MSAN build Signed-off-by: Kacper Michajłow --- libavformat/hlsenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index c9adbe5b44..0b69ae4b3b 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1472,6 +1472,7 @@ static int create_master_playlist(AVFormatContext *s, avg_bandwidth = vs->avg_bitrate; } else { bandwidth = 0; + avg_bandwidth = 0; if (vid_st) bandwidth += get_stream_bit_rate(vid_st); if (aud_st)