diff mbox

[FFmpeg-devel] avformat/apngdec: Return error for incomplete header

Message ID 20191211111414.27414-1-andreas.rheinhardt@gmail.com
State Superseded
Headers show

Commit Message

Andreas Rheinhardt Dec. 11, 2019, 11:14 a.m. UTC
When an incomplete header is encountered, apng_read_header would under
certain circumstances only return the return value of the last
successfull call. So override this by returning AVERROR(EIO) manually.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/apngdec.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Carl Eugen Hoyos Dec. 11, 2019, 2:37 p.m. UTC | #1
Am Mi., 11. Dez. 2019 um 12:14 Uhr schrieb Andreas Rheinhardt
<andreas.rheinhardt@gmail.com>:
>
> When an incomplete header is encountered, apng_read_header would under
> certain circumstances only return the return value of the last
> successfull call. So override this by returning AVERROR(EIO) manually.

What does this fix / does it possibly break files which where decoded so far?

Carl Eugen
diff mbox

Patch

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 0f1d04a365..65332c3fc5 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -240,6 +240,8 @@  static int apng_read_header(AVFormatContext *s)
         }
     }
 
+    return AVERROR(EIO);
+
 fail:
     return ret;
 }