avformat/img2dec: pass error code and signal EOF
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 25 Sep 2014 14:17:08 +0000 (16:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 4 Oct 2014 21:52:28 +0000 (23:52 +0200)
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2497914a1846c1dbcfb853ea834da0038f0e22f5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/img2dec.c

index ad77812..bb94126 100644 (file)
@@ -463,7 +463,13 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
 
     if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) {
         av_free_packet(pkt);
-        return AVERROR(EIO); /* signal EOF */
+        if (ret[0] < 0) {
+            return ret[0];
+        } else if (ret[1] < 0) {
+            return ret[1];
+        } else if (ret[2] < 0)
+            return ret[2];
+        return AVERROR_EOF;
     } else {
         s->img_count++;
         s->img_number++;