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

Git pushed a commit to branch master
in repository ffmpeg.

commit 9f690c6a4c124b9fc60588860ac66ae3fc808525
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Nov 5 18:32:35 2026 +0100
Commit:     michaelni <[email protected]>
CommitDate: Thu Nov 5 23:27:36 2026 +0000

    avcodec/sanm: use sizeof for the codec 23 LUT sizes
    
    Suggested-by: Marvin Scholz
---
 libavcodec/sanm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index 041466b210..dca5e7a7cc 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -791,18 +791,18 @@ static int old_codec23(SANMVideoContext *ctx, 
GetByteContext *gb, int top, int l
 
     if (ctx->subversion < 2) {
         /* Rebel Assault 1: constant offset + 0xd0 */
-        for (i = 0; i < 256; i++)
+        for (i = 0; i < sizeof(lut); i++)
             lut[i] = (i + param + 0xd0) & 0xff;
     } else if (param2 == 256) {
-        if (bytestream2_get_bytes_left(gb) < 256)
+        if (bytestream2_get_bytes_left(gb) < sizeof(ctx->c23lut))
             return AVERROR_INVALIDDATA;
-        bytestream2_get_bufferu(gb, ctx->c23lut, 256);
-        memcpy(lut, ctx->c23lut, 256);
+        bytestream2_get_bufferu(gb, ctx->c23lut, sizeof(ctx->c23lut));
+        memcpy(lut, ctx->c23lut, sizeof(lut));
     } else if (param2 < 256) {
-        for (i = 0; i < 256; i++)
+        for (i = 0; i < sizeof(lut); i++)
             lut[i] = (i + param2) & 0xff;
     } else {
-        memcpy(lut, ctx->c23lut, 256);
+        memcpy(lut, ctx->c23lut, sizeof(lut));
     }
     if (bytestream2_get_bytes_left(gb) < 1)
         return 0;  /* some c23 frames just set up the LUT */

-- 
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