Commit 43b1c4fe48 for ffmpeg

commit 43b1c4fe48757b0433dc0668769683eef1581029
Author: Ruk Doe <info@doany.io>
Date:   Sat Oct 10 16:32:15 2026 +0900

    avcodec/libaribcaption: reset the CLUT alpha table with the CLUT

    clut_alpha holds the alpha values pixels are snapped to, but only its
    first entry was reset for each rect; the others kept the values seeded
    by earlier captions. Those stayed available for quantization even when
    the current seed palette has no such alpha, so pixels could snap to a
    stale alpha, e.g. to 128 instead of 255 after an earlier caption with a
    semi-transparent color. Reset all entries with the CLUT.

    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 6a1a0848c5..996b591b13 100644
--- a/libavcodec/libaribcaption.c
+++ b/libavcodec/libaribcaption.c
@@ -254,6 +254,7 @@ static uint8_t clut_pick_or_set(ARIBCaptionContext *ctx, int r, int g, int b, in
 static void clut_reset(ARIBCaptionContext *ctx)
 {
     ctx->clut[0] = CLUT_RGBA(0,0,0,0); /* transparent */
+    memset(ctx->clut_alpha, 0, sizeof(ctx->clut_alpha));
     ctx->clut_alpha[0] = 0xFF;
     ctx->clut_idx = 1;
     ctx->clut_overflow = 0;