Skip to content

Commit

Permalink
avformat/subviewerdec: Simplify cleanup after read_header failure
Browse files Browse the repository at this point in the history
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Jul 8, 2021
1 parent c668638 commit 43ac74a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libavformat/subviewerdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 43ac74a

Please sign in to comment.