diff options
author | Michael Niedermayer | 2014-02-12 15:51:38 +0100 |
---|---|---|
committer | Michael Niedermayer | 2014-02-12 15:59:15 +0100 |
commit | d32926db7f4224305a08510c3adc2a3467b3ab2f (patch) | |
tree | f91cf1926cd3feb804b2b810b99e476824e84cf3 /libavformat/riffdec.c | |
parent | 8c5fece11fcb845f459eebb86b03f98d39e5880c (diff) |
avformat/riff: return error code from ff_get_guid()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/riffdec.c')
-rw-r--r-- | libavformat/riffdec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index c1e9ec1532..48c9a941b7 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -29,11 +29,14 @@ #include "avio_internal.h" #include "riff.h" -void ff_get_guid(AVIOContext *s, ff_asf_guid *g) +int ff_get_guid(AVIOContext *s, ff_asf_guid *g) { av_assert0(sizeof(*g) == 16); //compiler will optimize this out - if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g)) + if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g)) { memset(*g, 0, sizeof(*g)); + return AVERROR_INVALIDDATA; + } + return 0; } enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid) |