Several buffers allocated in the course of reading the header would leak
if an error happened after their allocation. Fix this by setting the
FF_INPUTFORMAT_HEADER_CLEANUP flag so that ape_read_close() will be called
to clean up in case of failure to read the header.

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com>
---
 libavformat/ape.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/ape.c b/libavformat/ape.c
index ed6752a415..81088bbc02 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -470,4 +470,5 @@ AVInputFormat ff_ape_demuxer = {
     .read_close     = ape_read_close,
     .read_seek      = ape_read_seek,
     .extensions     = "ape,apl,mac",
+    .flags_internal = FF_INPUTFORMAT_HEADER_CLEANUP,
 };
-- 
2.20.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to