[FFmpeg-cvslog] lavf/apngdec: Return EOF for incomplete files.

Carl Eugen Hoyos git at videolan.org
Thu Nov 8 14:39:02 EET 2018


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Wed Nov  7 01:31:18 2018 +0100| [5ff080fdfa25727abffe0fcf7dc50f6e194e02fd] | committer: Carl Eugen Hoyos

lavf/apngdec: Return EOF for incomplete files.

Fixes ticket #7536.

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

 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)



More information about the ffmpeg-cvslog mailing list