aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/FfmpegDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-09-09 19:07:46 +0200
committerMax Kellermann <max@duempel.org>2014-09-09 19:07:46 +0200
commitc14a00eec92074536591c05f0ac5486bf74980f9 (patch)
tree1baac3587f9c2b75741ffd22f49d805913fc0f28 /src/decoder/FfmpegDecoderPlugin.cxx
parent219c42522f938c5fff08d962a1a54c0872322f00 (diff)
downloadmpd-c14a00eec92074536591c05f0ac5486bf74980f9.tar.gz
mpd-c14a00eec92074536591c05f0ac5486bf74980f9.tar.xz
mpd-c14a00eec92074536591c05f0ac5486bf74980f9.zip
decoder/ffmpeg: use memset() to initialize AVProbeData
Diffstat (limited to 'src/decoder/FfmpegDecoderPlugin.cxx')
-rw-r--r--src/decoder/FfmpegDecoderPlugin.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx
index 1409a3c47..9cd26c4fa 100644
--- a/src/decoder/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/FfmpegDecoderPlugin.cxx
@@ -383,6 +383,12 @@ 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.uri.c_str();