aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/amr.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2017-03-31 06:54:01 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2017-03-31 18:19:41 +0200
commit76dd87c9296917bf6394b2a41820f92aeaeae447 (patch)
tree0d1f36a66e33c98866339e807012e47db25b556c /libavformat/amr.c
parent0505a1d9c4bec2e0e709dd6d9987b342b49a6360 (diff)
downloadffmpeg-76dd87c9296917bf6394b2a41820f92aeaeae447.tar.gz
lavf/amr: Return AVERROR_EOF on EOF.
Fixes ticket #6280.
Diffstat (limited to 'libavformat/amr.c')
-rw-r--r--libavformat/amr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/amr.c b/libavformat/amr.c
index 59963e14b8..b5194a2d9e 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);
}