diff --git a/libavformat/subviewerdec.c b/libavformat/subviewerdec.c index 06b827b70f..25fe7ac9a6 100644 --- a/libavformat/subviewerdec.c +++ b/libavformat/subviewerdec.c @@ -162,6 +162,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; }