by setting the FF_INPUTFORMAT_HEADER_CLEANUP flag.

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

diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index 551f8069e6..efa034c9ce 100644
--- a/libavformat/jvdec.c
+++ b/libavformat/jvdec.c
@@ -114,7 +114,6 @@ static int read_header(AVFormatContext *s)
 
     jv->frames = av_malloc(ast->nb_index_entries * sizeof(JVFrame));
     if (!jv->frames) {
-        av_freep(&ast->index_entries);
         return AVERROR(ENOMEM);
     }
     offset = 0x68 + ast->nb_index_entries * 16;
@@ -137,9 +136,6 @@ static int read_header(AVFormatContext *s)
                     - jvf->video_size
                     - jvf->palette_size < 0) {
             if (s->error_recognition & AV_EF_EXPLODE) {
-                read_close(s);
-                av_freep(&jv->frames);
-                av_freep(&ast->index_entries);
                 return AVERROR_INVALIDDATA;
             }
             jvf->audio_size   =
@@ -263,4 +259,5 @@ AVInputFormat ff_jv_demuxer = {
     .read_packet    = read_packet,
     .read_seek      = read_seek,
     .read_close     = read_close,
+    .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