demux_lavf: initialize ReplayGain data

This was causing undefined behavior when playing streams without RG tags
but with RG enabled. Broken in 585f9ff42f.

Thanks to uau for bisecting.
This commit is contained in:
Mia Herkt committed 2020-10-23 14:22:57 +02:00
1 parent a92466c289
commit 49d6a1e77d
1 file changed
+2
+2
View File
@@ -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