Ensure width is divisible by 4 (fixes #262)

This commit is contained in:
Michael Jumper 2013-01-23 01:34:51 -08:00
parent 40954430dc
commit 9faf4b0bf2

View File

@ -407,6 +407,9 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
argv[IDX_WIDTH], settings->width); argv[IDX_WIDTH], settings->width);
} }
/* Round width up to nearest multiple of 4 */
settings->width = (settings->width + 3) & ~0x3;
/* Use optimal height unless overridden */ /* Use optimal height unless overridden */
settings->height = client->info.optimal_height; settings->height = client->info.optimal_height;
if (argv[IDX_HEIGHT][0] != '\0') if (argv[IDX_HEIGHT][0] != '\0')