aboutsummaryrefslogtreecommitdiff
path: root/libavformat/riffdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer2014-02-12 15:51:38 +0100
committerMichael Niedermayer2014-02-12 15:59:15 +0100
commitd32926db7f4224305a08510c3adc2a3467b3ab2f (patch)
treef91cf1926cd3feb804b2b810b99e476824e84cf3 /libavformat/riffdec.c
parent8c5fece11fcb845f459eebb86b03f98d39e5880c (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.c7
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)