Commit 71f62751 authored by Clément Bœsch's avatar Clément Bœsch

avformat/assdec: make sure to free allocated data in case of error

parent 0e6bad12
...@@ -148,9 +148,6 @@ static int ass_read_header(AVFormatContext *s) ...@@ -148,9 +148,6 @@ static int ass_read_header(AVFormatContext *s)
sub->duration = duration; sub->duration = duration;
} }
av_bprint_finalize(&line, NULL);
av_bprint_finalize(&rline, NULL);
res = avpriv_bprint_to_extradata(st->codec, &header); res = avpriv_bprint_to_extradata(st->codec, &header);
if (res < 0) if (res < 0)
goto end; goto end;
...@@ -158,6 +155,9 @@ static int ass_read_header(AVFormatContext *s) ...@@ -158,6 +155,9 @@ static int ass_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(&ass->q); ff_subtitles_queue_finalize(&ass->q);
end: end:
av_bprint_finalize(&header, NULL);
av_bprint_finalize(&line, NULL);
av_bprint_finalize(&rline, NULL);
return res; return res;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment