1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

avformat/concatdec: Simplify cleanup after read_header failure

by setting the FF_FMT_INIT_CLEANUP flag.

(Btw: concat_read_close() is not idempotent (it frees cat->files, but
doesn't reset cat->nb_files), so this demuxer was incompatible with
simply calling read_close generically upon read_header failure.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2020-07-21 01:09:48 +02:00
parent b10668dd61
commit 2ca36ef08b

View File

@ -510,12 +510,9 @@ static int concat_read_header(AVFormatContext *avf)
MATCH_ONE_TO_ONE;
if ((ret = open_file(avf, 0)) < 0)
goto fail;
av_bprint_finalize(&bp, NULL);
return 0;
fail:
av_bprint_finalize(&bp, NULL);
concat_read_close(avf);
return ret;
}
@ -779,6 +776,7 @@ const AVInputFormat ff_concat_demuxer = {
.name = "concat",
.long_name = NULL_IF_CONFIG_SMALL("Virtual concatenation script"),
.priv_data_size = sizeof(ConcatContext),
.flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = concat_probe,
.read_header = concat_read_header,
.read_packet = concat_read_packet,