Commit d32926db authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/riff: return error code from ff_get_guid()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8c5fece1
......@@ -91,7 +91,7 @@ static av_always_inline int ff_guidcmp(const void *g1, const void *g2)
return memcmp(g1, g2, sizeof(ff_asf_guid));
}
void ff_get_guid(AVIOContext *s, ff_asf_guid *g);
int ff_get_guid(AVIOContext *s, ff_asf_guid *g);
void ff_put_guid(AVIOContext *s, const ff_asf_guid *g);
const ff_asf_guid *get_codec_guid(enum AVCodecID id, const AVCodecGuid *av_guid);
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment