From b1e190d0fddbad800a8b89f9ea840e73257bf6e5 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Tue, 20 Nov 2012 22:04:03 +0100 Subject: [PATCH] Correctly signal EOF when demuxing caf files. --- libavformat/cafdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index f166804795..8d39bfb831 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -348,7 +348,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) /* don't read past end of data chunk */ if (caf->data_size > 0) { left = (caf->data_start + caf->data_size) - avio_tell(pb); - if (left <= 0) + if (!left) + return AVERROR_EOF; + if (left < 0) return AVERROR(EIO); }