From e71da381cc8b92622eab636f88c2f95d358e34bf Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 3 Jul 2024 14:03:03 +0200 Subject: [PATCH] [uwac] fix wrong data type --- uwac/libuwac/uwac-window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/uwac/libuwac/uwac-window.c b/uwac/libuwac/uwac-window.c index da5bfe044..ce97e029c 100644 --- a/uwac/libuwac/uwac-window.c +++ b/uwac/libuwac/uwac-window.c @@ -328,13 +328,14 @@ int UwacWindowShmAllocBuffers(UwacWindow* w, int64_t nbuffers, int64_t allocSize return UWAC_ERROR_NOMEMORY; /* round up to a multiple of PAGESIZE to page align data for each buffer */ - UINT64 test = (0ull + allocSize + pagesize - 1ull) & ~(pagesize - 1); + uint64_t test = (0ull + allocSize + pagesize - 1ull) & ~(pagesize - 1); if (test > INT64_MAX) return UWAC_ERROR_NOMEMORY; allocSize = (int64_t)test; - UwacBuffer* newBuffers = xrealloc(w->buffers, (w->nbuffers + nbuffers) * sizeof(UwacBuffer)); + UwacBuffer* newBuffers = + xrealloc(w->buffers, (0ull + w->nbuffers + nbuffers) * sizeof(UwacBuffer)); if (!newBuffers) return UWAC_ERROR_NOMEMORY;