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

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

View the commit online.

commit 2a314057c4db09f3209ce432f2a7ed7f221b73e7
Author: NRK <n...@disroot.org>
AuthorDate: Tue Jun 20 15:05:01 2023 +0600

    Y4M loader: use memcmp()
---
 src/modules/loaders/loader_y4m.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/modules/loaders/loader_y4m.c b/src/modules/loaders/loader_y4m.c
index aefbcf9..af7cb09 100644
--- a/src/modules/loaders/loader_y4m.c
+++ b/src/modules/loaders/loader_y4m.c
@@ -106,15 +106,9 @@ static int
 y4m__match(const char *match, ptrdiff_t mlen,
            const uint8_t ** p, const uint8_t * end)
 {
-   const uint8_t      *m = (uint8_t *) match;
-   const uint8_t      *mend = m + mlen;
-   const uint8_t      *s = *p;
-
-   for (; s < end && m < mend && *s == *m; ++s, ++m)
-      ;
-   if (m == mend)
+   if (end - *p >= mlen && memcmp(match, *p, mlen) == 0)
      {
-        *p = s;
+        *p += mlen;
         return 1;
      }
    return 0;

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

Reply via email to