aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/assdec.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2014-09-27 17:49:49 +0200
committerClément Bœsch <u@pkh.me>2014-09-27 17:49:49 +0200
commit71f6275169cef3557375784cefcdc62883f3d620 (patch)
tree2b9790fa757443002298b2f49a3ea0fa55477aca /libavformat/assdec.c
parent0e6bad1229d44865caf452bfbca54d6a62a2f2c5 (diff)
downloadffmpeg-71f6275169cef3557375784cefcdc62883f3d620.tar.gz
avformat/assdec: make sure to free allocated data in case of error
Diffstat (limited to 'libavformat/assdec.c')
-rw-r--r--libavformat/assdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 1316e64596..ba7bc8b787 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -148,9 +148,6 @@ static int ass_read_header(AVFormatContext *s)
sub->duration = duration;
}
- av_bprint_finalize(&line, NULL);
- av_bprint_finalize(&rline, NULL);
-
res = avpriv_bprint_to_extradata(st->codec, &header);
if (res < 0)
goto end;
@@ -158,6 +155,9 @@ static int ass_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(&ass->q);
end:
+ av_bprint_finalize(&header, NULL);
+ av_bprint_finalize(&line, NULL);
+ av_bprint_finalize(&rline, NULL);
return res;
}