aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/FfmpegDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-09-11 19:24:52 +0200
committerMax Kellermann <max@duempel.org>2014-09-11 19:26:58 +0200
commita464dc681a64514ad7b8b8dbb7e4c64ea0561396 (patch)
tree7cd84bd8fcd394f73920d46a9628b79450f40cb3 /src/decoder/plugins/FfmpegDecoderPlugin.cxx
parentaf384d9aa6f216d3c5b890e3bd52140536c09686 (diff)
parenteaf675dc92fbe0143fdc0e9c4234bd78a889decf (diff)
downloadmpd-a464dc681a64514ad7b8b8dbb7e4c64ea0561396.tar.gz
mpd-a464dc681a64514ad7b8b8dbb7e4c64ea0561396.tar.xz
mpd-a464dc681a64514ad7b8b8dbb7e4c64ea0561396.zip
Merge tag 'v0.18.14'
Diffstat (limited to 'src/decoder/plugins/FfmpegDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/FfmpegDecoderPlugin.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 7f4ac8bcc..904e21a5a 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -412,10 +412,23 @@ ffmpeg_probe(Decoder *decoder, InputStream &is)
nbytes -= PADDING;
AVProbeData avpd;
+
+ /* new versions of ffmpeg may add new attributes, and leaving
+ them uninitialized may crash; hopefully, zero-initializing
+ everything we don't know is ok */
+ memset(&avpd, 0, sizeof(avpd));
+
avpd.buf = buffer;
avpd.buf_size = nbytes;
avpd.filename = is.GetURI();
+#ifdef AVPROBE_SCORE_MIME
+ /* this attribute was added in libav/ffmpeg version 11, but
+ unfortunately it's "uint8_t" instead of "char", and it's
+ not "const" - wtf? */
+ avpd.mime_type = (uint8_t *)const_cast<char *>(is.GetMimeType());
+#endif
+
return av_probe_input_format(&avpd, true);
}