[FFmpeg-devel] [PATCH 42/54] avformat/sierravmd: Simplify cleanup after read_header failure
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Wed Jun 16 02:32:31 EEST 2021
by setting the FF_FMT_INIT_CLEANUP flag.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavformat/sierravmd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
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,
--
2.27.0
More information about the ffmpeg-devel
mailing list