From 5ff080fdfa25727abffe0fcf7dc50f6e194e02fd Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Wed, 7 Nov 2018 01:31:18 +0100 Subject: [PATCH] lavf/apngdec: Return EOF for incomplete files. Fixes ticket #7536. --- libavformat/apngdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c index f9a97e5681..53cdd4538e 100644 --- a/libavformat/apngdec.c +++ b/libavformat/apngdec.c @@ -342,6 +342,10 @@ static int apng_read_packet(AVFormatContext *s, AVPacket *pkt) len = avio_rb32(pb); tag = avio_rl32(pb); + + if (avio_feof(pb)) + return AVERROR_EOF; + switch (tag) { case MKTAG('f', 'c', 'T', 'L'): if (len != 26)