summaryrefslogtreecommitdiff
path: root/libavformat/samidec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/samidec.c')
-rw-r--r--libavformat/samidec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/samidec.c b/libavformat/samidec.c
index cf5076c7b8..d84f56ce6f 100644
--- a/libavformat/samidec.c
+++ b/libavformat/samidec.c
@@ -89,6 +89,7 @@ static int sami_read_header(AVFormatContext *s)
sub = ff_subtitles_queue_insert(&sami->q, buf.str, buf.len, !is_sync);
if (!sub) {
res = AVERROR(ENOMEM);
+ av_bprint_finalize(&hdr_buf, NULL);
goto end;
}
if (is_sync) {
@@ -97,6 +98,7 @@ static int sami_read_header(AVFormatContext *s)
sub->pts = p ? strtol(p, NULL, 10) : 0;
if (sub->pts <= INT64_MIN/2 || sub->pts >= INT64_MAX/2) {
res = AVERROR_PATCHWELCOME;
+ av_bprint_finalize(&hdr_buf, NULL);
goto end;
}