mirror of https://github.com/FreeRDP/FreeRDP
Added some checks
This commit is contained in:
parent
0bf2faedc4
commit
2b18d25731
|
@ -92,6 +92,9 @@ static BOOL wl_end_paint(rdpContext* context)
|
|||
context_w = (wlfContext*) context;
|
||||
|
||||
data = UwacWindowGetDrawingBuffer(context_w->window);
|
||||
if (!data)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < h; i++)
|
||||
{
|
||||
memcpy(data + ((i+y)*(gdi->width*4)) + x*4,
|
||||
|
@ -99,7 +102,9 @@ static BOOL wl_end_paint(rdpContext* context)
|
|||
w*4);
|
||||
}
|
||||
|
||||
UwacWindowAddDamage(context_w->window, x, y, w, h);
|
||||
if (UwacWindowAddDamage(context_w->window, x, y, w, h) != UWAC_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
context_w->haveDamage = TRUE;
|
||||
return wl_update_content(context_w);
|
||||
}
|
||||
|
|
|
@ -742,6 +742,8 @@ seat_handle_name(void *data, struct wl_seat *seat, const char *name)
|
|||
free(input->name);
|
||||
|
||||
input->name = strdup(name);
|
||||
if (!input->name)
|
||||
assert(uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, "unable to strdup seat's name\n"));
|
||||
}
|
||||
|
||||
static const struct wl_seat_listener seat_listener = {
|
||||
|
|
|
@ -296,6 +296,10 @@ int UwacWindowShmAllocBuffers(UwacWindow *w, int nbuffers, int allocSize, uint32
|
|||
}
|
||||
|
||||
pool = wl_shm_create_pool(w->display->shm, fd, allocSize * nbuffers);
|
||||
if (!pool) {
|
||||
ret = UWAC_ERROR_NOMEMORY;
|
||||
goto error_mmap;
|
||||
}
|
||||
|
||||
for (i = 0; i < nbuffers; i++) {
|
||||
UwacBuffer *buffer = &w->buffers[w->nbuffers + i];
|
||||
|
|
Loading…
Reference in New Issue