xup: check for g_shmat failure and change error case
This commit is contained in:
parent
ba6c71fd37
commit
98fbca98db
10
xup/xup.c
10
xup/xup.c
@ -1125,6 +1125,12 @@ process_server_paint_rect_shmem(struct mod *mod, struct stream *s)
|
|||||||
{
|
{
|
||||||
mod->screen_shmem_id = shmem_id;
|
mod->screen_shmem_id = shmem_id;
|
||||||
mod->screen_shmem_pixels = g_shmat(mod->screen_shmem_id);
|
mod->screen_shmem_pixels = g_shmat(mod->screen_shmem_id);
|
||||||
|
if (mod->screen_shmem_pixels == (void*)-1)
|
||||||
|
{
|
||||||
|
/* failed */
|
||||||
|
mod->screen_shmem_id = 0;
|
||||||
|
mod->screen_shmem_pixels = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mod->screen_shmem_pixels != 0)
|
if (mod->screen_shmem_pixels != 0)
|
||||||
{
|
{
|
||||||
@ -1137,10 +1143,6 @@ process_server_paint_rect_shmem(struct mod *mod, struct stream *s)
|
|||||||
bmpdata, width, height,
|
bmpdata, width, height,
|
||||||
srcx, srcy);
|
srcx, srcy);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
rv = 1;
|
|
||||||
}
|
|
||||||
send_paint_rect_ack(mod, flags, x, y, cx, cy, frame_id);
|
send_paint_rect_ack(mod, flags, x, y, cx, cy, frame_id);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user