Commit 2a759286a2 for ffmpeg
commit 2a759286a2abe49ae422cb1725aa11964342e778
Author: Ruk Doe <info@doany.io>
Date: Sat Oct 10 14:46:27 2026 +0900
avcodec/libaribcaption: check ff_ass_add_rect() when clearing in ass mode
The clear path ignored the return value of ff_ass_add_rect() and
reported an event even if adding the empty rect failed, unlike the other
two calls in this function. Return the error instead; the caller frees
the partially built subtitle.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdDiDRusmi6eD7qSrKBjHb
diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c
index b8b5ad8a47..b9a7c2ff80 100644
--- a/libavcodec/libaribcaption.c
+++ b/libavcodec/libaribcaption.c
@@ -625,8 +625,8 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
return 0;
/* clear previous caption for indefinite duration */
sub->format = 1; /* text */
- ff_ass_add_rect(sub, "", ctx->readorder++, 0, NULL, NULL);
- return 1;
+ ret = ff_ass_add_rect(sub, "", ctx->readorder++, 0, NULL, NULL);
+ return ret < 0 ? ret : 1;
}
sub->format = 1; /* text */