Don't segfault taking a screenshot in gtk frontend with non default rotation

Patch from #2998869 by noodlebox.
This commit is contained in:
riccardom 2010-05-12 15:26:05 +00:00
parent b41476712b
commit 2fdb8c875f
1 changed files with 2 additions and 2 deletions

View File

@ -1560,11 +1560,11 @@ static void Printscreen()
u8 *rgb; u8 *rgb;
static int seq = 0; static int seq = 0;
rgb = (u8 *) malloc(SCREENS_PIXEL_SIZE*3); rgb = (u8 *) malloc(SCREENS_PIXEL_SIZE*SCREEN_BYTES_PER_PIXEL);
if (!rgb) if (!rgb)
return; return;
gpu_screen_to_rgb(rgb, SCREENS_PIXEL_SIZE); gpu_screen_to_rgb(rgb, SCREENS_PIXEL_SIZE*SCREEN_BYTES_PER_PIXEL);
screenshot = gdk_pixbuf_new_from_data(rgb, screenshot = gdk_pixbuf_new_from_data(rgb,
GDK_COLORSPACE_RGB, GDK_COLORSPACE_RGB,
FALSE, FALSE,