avformat/subviewerdec: 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 c6686388aa
commit 43ac74a7d8
1 changed files with 1 additions and 2 deletions

View File

@ -176,8 +176,6 @@ static int subviewer_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &subviewer->q);
end:
if (res < 0)
ff_subtitles_queue_clean(&subviewer->q);
av_bprint_finalize(&header, NULL);
return res;
}
@ -207,6 +205,7 @@ const AVInputFormat ff_subviewer_demuxer = {
.name = "subviewer",
.long_name = NULL_IF_CONFIG_SMALL("SubViewer subtitle format"),
.priv_data_size = sizeof(SubViewerContext),
.flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = subviewer_probe,
.read_header = subviewer_read_header,
.read_packet = subviewer_read_packet,