aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-05-18 11:38:10 +0200
committerPaul B Mahol <onemda@gmail.com>2023-05-18 11:59:34 +0200
commitc48eff209ccd4ffc72a34dbbb9dd2be2fab4ded8 (patch)
tree29f26bdacdd272c8f3d0093c221a43bc4851e27e
parent96c30affba5123bf3ba7df0ec64fee1eded3d473 (diff)
downloadffmpeg-c48eff209ccd4ffc72a34dbbb9dd2be2fab4ded8.tar.gz
avcodec/ccaptions_dec: correct flushing output on EOF
Prevents infinite flushing same last output.
-rw-r--r--libavcodec/ccaption_dec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 661a4951a4..0f5b955f15 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -900,6 +900,7 @@ static int decode(AVCodecContext *avctx, AVSubtitle *sub,
ret = ff_ass_add_rect2(sub, ctx->buffer[bidx].str, ctx->readorder++, 0, NULL, NULL, &nb_rect_allocated);
if (ret < 0)
return ret;
+ av_bprint_clear(&ctx->buffer[bidx]);
sub->pts = ctx->buffer_time[1];
sub->end_display_time = av_rescale_q(ctx->buffer_time[1] - ctx->buffer_time[0],
AV_TIME_BASE_Q, ms_tb);