Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-28 13:56:22 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-06-28 14:04:47 +0300
commitda0616985095202434a4dfd30eb2ea09e3a57938 (patch)
tree813e9b647719a2125b2326b75f54cc3bb20320c5 /libavformat/riffdec.c
parent0940169743aa28e51f10da082fb48314da9af2c9 (diff)
avformat/riffdec: Forward error code from avio_read() in ff_get_guid()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/riffdec.c')
-rw-r--r--libavformat/riffdec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c
index f44df1e672..a2bfb44719 100644
--- a/libavformat/riffdec.c
+++ b/libavformat/riffdec.c
@@ -31,10 +31,12 @@
int ff_get_guid(AVIOContext *s, ff_asf_guid *g)
{
+ int ret;
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));
- return AVERROR_INVALIDDATA;
+ return ret < 0 ? ret : AVERROR_INVALIDDATA;
}
return 0;
}