diff mbox

[FFmpeg-devel] lavf/apngdec: Return eof for incomplete files

Message ID CAB0OVGrTRhQiBOcR9JUWcsiYuddZCSaNw70osMixSw_RazzDUA@mail.gmail.com
State Superseded
Headers show

Commit Message

Carl Eugen Hoyos Nov. 6, 2018, 11:11 p.m. UTC
Hi!

Attached patch silences the console flooding for incomplete apng files
and fixes ticket #7536:
In-stream tag=[0][0][0][0] (0x00000000) len=0 is not implemented.
Update your FFmpeg version...

Please comment, Carl Eugen

Comments

Marton Balint Nov. 7, 2018, 12:07 a.m. UTC | #1
On Wed, 7 Nov 2018, Carl Eugen Hoyos wrote:

> Hi!
>
> Attached patch silences the console flooding for incomplete apng files
> and fixes ticket #7536:
> In-stream tag=[0][0][0][0] (0x00000000) len=0 is not implemented.
> Update your FFmpeg version...
>
> Please comment, Carl Eugen
>

>+
>+    if (pb->eof_reached)
>+        return AVERROR_EOF;
>+

Why not avio_feof(pb)?

Regards,
Marton
diff mbox

Patch

From dd384a34e1e8ca52f639132d3ba002c5b0534391 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Wed, 7 Nov 2018 00:09:31 +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 f9a97e5..0ee3092 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 (pb->eof_reached)
+        return AVERROR_EOF;
+
     switch (tag) {
     case MKTAG('f', 'c', 'T', 'L'):
         if (len != 26)
-- 
1.7.10.4