diff options
author | Max Kellermann <max@duempel.org> | 2014-09-09 19:07:46 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-09-09 19:07:46 +0200 |
commit | c14a00eec92074536591c05f0ac5486bf74980f9 (patch) | |
tree | 1baac3587f9c2b75741ffd22f49d805913fc0f28 | |
parent | 219c42522f938c5fff08d962a1a54c0872322f00 (diff) | |
download | mpd-c14a00eec92074536591c05f0ac5486bf74980f9.tar.gz mpd-c14a00eec92074536591c05f0ac5486bf74980f9.tar.xz mpd-c14a00eec92074536591c05f0ac5486bf74980f9.zip |
decoder/ffmpeg: use memset() to initialize AVProbeData
-rw-r--r-- | src/decoder/FfmpegDecoderPlugin.cxx | 6 |
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(); |