From 49d6a1e77d3dba5cf30a2cb9cd05dc6dd6407fb2 Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Fri, 23 Oct 2020 14:22:57 +0200 Subject: demux_lavf: initialize ReplayGain data This was causing undefined behavior when playing streams without RG tags but with RG enabled. Broken in 585f9ff42f3195c. Thanks to uau for bisecting. --- demux/demux_lavf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 6aaf279c4b..1bc8699e15 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -610,6 +610,8 @@ static void export_replaygain(demuxer_t *demuxer, struct sh_stream *sh, av_rgain = (AVReplayGain*)src_sd->data; rgain = talloc_ptrtype(demuxer, rgain); + rgain->track_gain = rgain->album_gain = 0; + rgain->track_peak = rgain->album_peak = 1; // Set values in *rgain, using track gain as a fallback for album gain // if the latter is not present. This behavior matches that in -- cgit v1.2.3