[FFmpeg-cvslog] avformat/riffdec: Forward error code from avio_read() in ff_get_guid()

Michael Niedermayer git at videolan.org
Sun Jun 28 13:05:26 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 28 12:56:22 2015 +0200| [da0616985095202434a4dfd30eb2ea09e3a57938] | committer: Michael Niedermayer

avformat/riffdec: Forward error code from avio_read() in ff_get_guid()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da0616985095202434a4dfd30eb2ea09e3a57938
---

 libavformat/riffdec.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c
index f44df1e..a2bfb44 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;
 }



More information about the ffmpeg-cvslog mailing list