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

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 1e04f4f94927d3b135e6c49a9b22104f7d964083
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Fri Jan 17 13:31:04 2025 +0100

    loaders: Fix gcc15 warnings
---
 src/modules/loaders/loader_qoi.c | 4 ++--
 src/modules/loaders/loader_y4m.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/modules/loaders/loader_qoi.c b/src/modules/loaders/loader_qoi.c
index f5b5a61..22016de 100644
--- a/src/modules/loaders/loader_qoi.c
+++ b/src/modules/loaders/loader_qoi.c
@@ -49,7 +49,7 @@ QOIDEC_API QoiDecStatus qoi_dec(QoiDecCtx * ctx);
 QOIDEC_API      QoiDecStatus
 qoi_dec_init(QoiDecCtx *ctx, const void *buffer, ptrdiff_t size)
 {
-    static const uint8_t magic[4] = "qoif";
+    static const char magic[] = "qoif";
 
     QOIDEC_ASSERT(size >= 0);
 
@@ -57,7 +57,7 @@ qoi_dec_init(QoiDecCtx *ctx, const void *buffer, ptrdiff_t size)
 
     ctx->p = buffer;
     ctx->end = ctx->p + size;
-    if (size < 14 || memcmp(ctx->p, magic, sizeof(magic)) != 0)
+    if (size < 14 || memcmp(ctx->p, magic, sizeof(magic) - 1) != 0)
         return QOIDEC_NOT_QOI;
     ctx->p += 4;
 
diff --git a/src/modules/loaders/loader_y4m.c b/src/modules/loaders/loader_y4m.c
index 01e558c..2f4af14 100644
--- a/src/modules/loaders/loader_y4m.c
+++ b/src/modules/loaders/loader_y4m.c
@@ -296,14 +296,14 @@ y4m__parse_params(Y4mParse *res, const uint8_t **start, const uint8_t *end)
 Y4M_PARSE_API enum Y4mParseStatus
 y4m_parse_init(Y4mParse *res, const void *buffer, ptrdiff_t size)
 {
-    const char      magic[10] = "YUV4MPEG2 ";
+    static const char magic[] = "YUV4MPEG2 ";
 
     memset(res, 0x0, sizeof(*res));
     res->w = res->h = -1;
     res->p = buffer;
     res->end = res->p + size;
 
-    if (!y4m__match(magic, sizeof(magic), &res->p, res->end))
+    if (!y4m__match(magic, sizeof(magic) - 1, &res->p, res->end))
     {
         return Y4M_PARSE_NOT_Y4M;
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to