diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c index 4ff49ba3cf..b00f0f114d 100644 --- a/libavformat/mpsubdec.c +++ b/libavformat/mpsubdec.c @@ -106,6 +106,9 @@ static int mpsub_read_header(AVFormatContext *s) ff_subtitles_queue_finalize(s, &mpsub->q); end: + if (res < 0) + ff_subtitles_queue_clean(&mpsub->q); + av_bprint_finalize(&buf, NULL); return res; }