Skip to content

Commit

Permalink
avformat/subviewerdec: Fix memleak upon read header failure
Browse files Browse the repository at this point in the history
The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Jun 15, 2020
1 parent 9751d75 commit a708f65
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavformat/subviewerdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ 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

0 comments on commit a708f65

Please sign in to comment.