[FFmpeg-cvslog] riffdec: Explicitly null-terminate array to work around VC++ bug
Bruce Dawson
git at videolan.org
Mon Feb 1 10:45:19 CET 2016
ffmpeg | branch: master | Bruce Dawson <brucedawson at chromium.org> | Thu Jan 28 13:06:07 2016 -0800| [09b3a42495b43d1bfc5ed36d924b6223b0761f91] | committer: Hendrik Leppkes
riffdec: Explicitly null-terminate array to work around VC++ bug
Due to this bug in VC++ 2015 Update 1:
https://connect.microsoft.com/VisualStudio/feedback/details/2291638
the 'key' array in ff_read_riff_info() ends up being not null
terminated which led to failures in a Chromium unit tests. Update 2
should have a fix, but until then it is important to avoid problems.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=09b3a42495b43d1bfc5ed36d924b6223b0761f91
---
libavformat/riffdec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c
index aa637b6..d7b81a0 100644
--- a/libavformat/riffdec.c
+++ b/libavformat/riffdec.c
@@ -279,6 +279,9 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
}
AV_WL32(key, chunk_code);
+ // Work around VC++ 2015 Update 1 code-gen bug:
+ // https://connect.microsoft.com/VisualStudio/feedback/details/2291638
+ key[4] = 0;
if (avio_read(pb, value, chunk_size) != chunk_size) {
av_log(s, AV_LOG_WARNING,
More information about the ffmpeg-cvslog
mailing list