[FFmpeg-cvslog] avformat/img2dec: pass error code and signal EOF

Michael Niedermayer git at videolan.org
Thu Sep 25 16:28:49 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Sep 25 16:17:08 2014 +0200| [2497914a1846c1dbcfb853ea834da0038f0e22f5] | committer: Michael Niedermayer

avformat/img2dec: pass error code and signal EOF

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

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

 libavformat/img2dec.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index ad77812..bb94126 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -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++;



More information about the ffmpeg-cvslog mailing list