From bf959ac2c68111449cfdfb550a08ef37a537c994 Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Sun, 2 Sep 2012 17:37:11 +1000 Subject: [PATCH] tty: return EOF when the 'effective' end of file is reached. ('effective' because ansi/tty files may be concatenated with SAUCE/EFI metadata) Signed-off-by: Michael Niedermayer --- libavformat/tty.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/tty.c b/libavformat/tty.c index b86dd79ca0..a71c6b1939 100644 --- a/libavformat/tty.c +++ b/libavformat/tty.c @@ -128,6 +128,8 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt) if (s->fsize) { // ignore metadata buffer uint64_t p = avio_tell(avctx->pb); + if (p == s->fsize) + return AVERROR_EOF; if (p + s->chars_per_frame > s->fsize) n = s->fsize - p; }