[FFmpeg-cvslog] Fix ff_get_guid for short reads or errors.
Reimar Döffinger
git at videolan.org
Sun Jan 15 20:38:26 CET 2012
ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sun Jan 15 16:58:21 2012 +0100| [ea3abcd58f83673bf2fe28170339f19ddf683442] | committer: Reimar Döffinger
Fix ff_get_guid for short reads or errors.
Current code would just return uninitialized data with no way
to detect this condition.
Instead, fill the whole GUID with 0 in that case.
Fixes valgrind uninitialized data errors in fate-seek-lavf_asf.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea3abcd58f83673bf2fe28170339f19ddf683442
---
libavformat/riff.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 0a2bddc..0bfee5a 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -675,7 +675,8 @@ void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssiz
void ff_get_guid(AVIOContext *s, ff_asf_guid *g)
{
assert(sizeof(*g) == 16);
- avio_read(s, *g, sizeof(*g));
+ if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g))
+ memset(*g, 0, sizeof(*g));
}
enum CodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid)
More information about the ffmpeg-cvslog
mailing list