decoder/ffmpeg: add missing nullptr checks

Fixes part 1 of https://github.com/MusicPlayerDaemon/MPD/issues/1490
This commit is contained in:
Max Kellermann 2022-04-26 20:51:49 +02:00
parent 85f9863e0a
commit f2a3dfd700

View File

@ -384,7 +384,8 @@ static void
FfmpegParseMetaData(const AVStream &stream,
ReplayGainInfo &rg, MixRampInfo &mr)
{
FfmpegParseMetaData(*stream.metadata, rg, mr);
if (stream.metadata != nullptr)
FfmpegParseMetaData(*stream.metadata, rg, mr);
}
static void
@ -393,7 +394,9 @@ FfmpegParseMetaData(const AVFormatContext &format_context, int audio_stream,
{
assert(audio_stream >= 0);
FfmpegParseMetaData(*format_context.metadata, rg, mr);
if (format_context.metadata != nullptr)
FfmpegParseMetaData(*format_context.metadata, rg, mr);
FfmpegParseMetaData(*format_context.streams[audio_stream],
rg, mr);
}