From 6b60d1e71f967792e7e3936ea58c4218fbbf01b9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 24 Apr 2017 20:36:55 +0200 Subject: [PATCH] decoder/pcm: add missing nullptr check Fixes a potential crash bug which is actually unreachable, because the "pcm" plugin is never invoked when there is no (matching) MIME type. --- src/decoder/plugins/PcmDecoderPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoder/plugins/PcmDecoderPlugin.cxx b/src/decoder/plugins/PcmDecoderPlugin.cxx index a74db186b..32d4fd133 100644 --- a/src/decoder/plugins/PcmDecoderPlugin.cxx +++ b/src/decoder/plugins/PcmDecoderPlugin.cxx @@ -81,7 +81,7 @@ pcm_stream_decode(DecoderClient &client, InputStream &is) if (is_float) audio_format.format = SampleFormat::FLOAT; - { + if (mime != nullptr) { const auto mime_parameters = ParseMimeTypeParameters(mime); /* MIME type parameters according to RFC 2586 */