Author: abrander
Date: 2010-05-28 18:49:05 +0200 (Fri, 28 May 2010)
New Revision: 3401
Modified:
trunk/src/rs-preview-widget.c
Log:
[387] Clamping coordinates before requesting pixels from GdkPixbuf in
make_cbdata().
Modified: trunk/src/rs-preview-widget.c
===================================================================
--- trunk/src/rs-preview-widget.c 2010-05-28 16:13:59 UTC (rev 3400)
+++ trunk/src/rs-preview-widget.c 2010-05-28 16:49:05 UTC (rev 3401)
@@ -2541,6 +2541,10 @@
cbdata->x = real_x;
cbdata->y = real_y;
+ /* Make sure these is within boundaries */
+ screen_x = CLAMP(screen_x, 0, gdk_pixbuf_get_width(buffer)-1);
+ screen_y = CLAMP(screen_y, 0, gdk_pixbuf_get_height(buffer)-1);
+
cbdata->pixel8[R] = GET_PIXBUF_PIXEL(buffer, screen_x, screen_y)[R];
cbdata->pixel8[G] = GET_PIXBUF_PIXEL(buffer, screen_x, screen_y)[G];
cbdata->pixel8[B] = GET_PIXBUF_PIXEL(buffer, screen_x, screen_y)[B];
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit