Commit f5338791 authored by Jeremy White's avatar Jeremy White Committed by Frediano Ziglio
Browse files

Prevent a buffer overflow if the cached screen does not match current screen.

Acked-by: Frediano Ziglio's avatarFrediano Ziglio <>
parent c0d05f9e
......@@ -616,6 +616,12 @@ int display_scan_whole_screen(display_t *d, int num_vertical_tiles, int num_hori
ret = read_shm_image(d, fullscreen_new, 0, 0);
if (ret == 0) {
if (d->fullscreen->h != fullscreen_new->h || d->fullscreen->w != fullscreen_new->w) {
/* If we're in the middle of a screen resize, just bail */
destroy_shm_image(d, fullscreen_new);
return 0;
for (v_tile = 0; v_tile < num_vertical_tiles; v_tile++) {
/* Note that integer math and multiplying first is important;
especially in the case where our screen height is not a
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment