mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-07 07:40:16 +00:00
avformat/riffdec: Forward error code from avio_read() in ff_get_guid()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0940169743
commit
da06169850
@ -31,10 +31,12 @@
|
|||||||
|
|
||||||
int ff_get_guid(AVIOContext *s, ff_asf_guid *g)
|
int ff_get_guid(AVIOContext *s, ff_asf_guid *g)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
av_assert0(sizeof(*g) == 16); //compiler will optimize this out
|
av_assert0(sizeof(*g) == 16); //compiler will optimize this out
|
||||||
if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g)) {
|
ret = avio_read(s, *g, sizeof(*g));
|
||||||
|
if (ret < (int)sizeof(*g)) {
|
||||||
memset(*g, 0, sizeof(*g));
|
memset(*g, 0, sizeof(*g));
|
||||||
return AVERROR_INVALIDDATA;
|
return ret < 0 ? ret : AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user