1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avformat/vividas: Simplify cleanup after read_header failure

by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2020-03-21 18:31:06 +01:00
parent c1141aa71a
commit 21e40af378

View File

@@ -613,7 +613,7 @@ static int viv_read_header(AVFormatContext *s)
ret = track_index(viv, s, buf, v); ret = track_index(viv, s, buf, v);
av_free(buf); av_free(buf);
if (ret < 0) if (ret < 0)
goto fail; return ret;
viv->sb_offset = avio_tell(pb); viv->sb_offset = avio_tell(pb);
if (viv->n_sb_blocks > 0) { if (viv->n_sb_blocks > 0) {
@@ -624,9 +624,6 @@ static int viv_read_header(AVFormatContext *s)
} }
return 0; return 0;
fail:
av_freep(&viv->sb_blocks);
return ret;
} }
static int viv_read_packet(AVFormatContext *s, static int viv_read_packet(AVFormatContext *s,
@@ -785,6 +782,7 @@ const AVInputFormat ff_vividas_demuxer = {
.name = "vividas", .name = "vividas",
.long_name = NULL_IF_CONFIG_SMALL("Vividas VIV"), .long_name = NULL_IF_CONFIG_SMALL("Vividas VIV"),
.priv_data_size = sizeof(VividasDemuxContext), .priv_data_size = sizeof(VividasDemuxContext),
.flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = viv_probe, .read_probe = viv_probe,
.read_header = viv_read_header, .read_header = viv_read_header,
.read_packet = viv_read_packet, .read_packet = viv_read_packet,