[FFmpeg-cvslog] lavf/amr: Return AVERROR_EOF on EOF.

Carl Eugen Hoyos git at videolan.org
Fri Mar 31 19:20:59 EEST 2017


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Fri Mar 31 06:54:01 2017 +0200| [76dd87c9296917bf6394b2a41820f92aeaeae447] | committer: Carl Eugen Hoyos

lavf/amr: Return AVERROR_EOF on EOF.

Fixes ticket #6280.

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

 libavformat/amr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/amr.c b/libavformat/amr.c
index 59963e1..b5194a2 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -118,7 +118,7 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
     AMRContext *amr = s->priv_data;
 
     if (avio_feof(s->pb)) {
-        return AVERROR(EIO);
+        return AVERROR_EOF;
     }
 
     // FIXME this is wrong, this should rather be in an AVParser
@@ -156,6 +156,8 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
 
     if (read != size - 1) {
         av_packet_unref(pkt);
+        if (read < 0)
+            return read;
         return AVERROR(EIO);
     }
 



More information about the ffmpeg-cvslog mailing list