diff mbox series

[FFmpeg-devel,42/54] avformat/sierravmd: Simplify cleanup after read_header failure

Message ID HE1PR0301MB2154DC73F20F78DAD58A10D68F309@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 1ebda24904d786a1d57093da3d6a1eec5ea939a4
Headers show
Series [FFmpeg-devel,01/54] avformat: Add internal flags for AV(In|Out)putFormat | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt June 15, 2021, 11:32 p.m. UTC
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/sierravmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 13304b0596..e35faae50d 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -252,16 +252,13 @@  static int vmd_read_header(AVFormatContext *s)
         }
     }
 
-    av_free(raw_frame_table);
 
     vmd->current_frame = 0;
     vmd->frame_count = total_frames;
 
-    return 0;
-
+    ret = 0;
 error:
     av_freep(&raw_frame_table);
-    av_freep(&vmd->frame_table);
     return ret;
 }
 
@@ -321,6 +318,7 @@  const AVInputFormat ff_vmd_demuxer = {
     .name           = "vmd",
     .long_name      = NULL_IF_CONFIG_SMALL("Sierra VMD"),
     .priv_data_size = sizeof(VmdDemuxContext),
+    .flags_internal = FF_FMT_INIT_CLEANUP,
     .read_probe     = vmd_probe,
     .read_header    = vmd_read_header,
     .read_packet    = vmd_read_packet,