This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit d0218dabb39cc782e0fee9dc2e05f70500959d4f
Author:     Ruk Doe <[email protected]>
AuthorDate: Sat Oct 10 15:50:24 2026 +0900
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sun Nov 15 05:26:10 2026 +0100

    avcodec/libaribcaption: free only the added rects on ass errors
    
    The ass error path freed sub->rects[0] .. [region_count - 1], but
    ff_ass_add_rect() grows the array one rect at a time and counts the
    rects it added in sub->num_rects, including one whose dialog string
    failed to allocate. Entries past num_rects are not initialized, so an
    allocation failure part way through read them, or past the array.
    
    Free up to sub->num_rects instead.
    
    Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
    Claude-Session: https://claude.ai/code/session_01DdDiDRusmi6eD7qSrKBjHb
    Reported-by: Forgejo_Fairy
    Reference: #24992
    Found-by: Joshua Rogers <[email protected]>
    (cherry picked from commit 4ec127c82678b06658e963291f272881dc878735)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/libaribcaption.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c
index 340e8866f8..957cb86f78 100644
--- a/libavcodec/libaribcaption.c
+++ b/libavcodec/libaribcaption.c
@@ -791,7 +791,7 @@ static int 
aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
 
 fail:
     if (sub->rects) {
-        for (int i = 0; i < ctx->caption.region_count; i++) {
+        for (int i = 0; i < sub->num_rects; i++) {
             if (sub->rects[i]) {
                 av_freep(&sub->rects[i]->ass);
                 av_freep(&sub->rects[i]);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to