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 2020-10-23 14:22:57 +02:00
parent a92466c289
commit 49d6a1e77d
No known key found for this signature in database
GPG Key ID: 72E154B8622EC191
1 changed files with 2 additions and 0 deletions

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