mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[coverity] fix warnings
This commit is contained in:
@@ -246,9 +246,11 @@ void* UwacClipboardDataGet(UwacSeat* seat, const char* mime, size_t* size)
|
||||
|
||||
do
|
||||
{
|
||||
void* tmp = NULL;
|
||||
if (alloc >= SIZE_MAX - 1024)
|
||||
goto fail;
|
||||
|
||||
alloc += 1024;
|
||||
tmp = xrealloc(data, alloc);
|
||||
void* tmp = xrealloc(data, alloc);
|
||||
if (!tmp)
|
||||
goto fail;
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ static void UwacWindowDestroyBuffers(UwacWindow* w)
|
||||
w->buffers = NULL;
|
||||
}
|
||||
|
||||
WINPR_ATTR_MALLOC(UwacWindowDestroyBuffers, 1)
|
||||
static int UwacWindowShmAllocBuffers(UwacWindow* w, int64_t nbuffers, int64_t allocSize,
|
||||
uint32_t width, uint32_t height, enum wl_shm_format format);
|
||||
|
||||
@@ -331,7 +332,7 @@ 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_t test = (0ull + allocSize + pagesize - 1ull) & ~(pagesize - 1);
|
||||
const uint64_t test = (1ull * allocSize + pagesize - 1ull) & ~(pagesize - 1);
|
||||
if (test > INT64_MAX)
|
||||
return UWAC_ERROR_NOMEMORY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user