< prev index next >
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
Print this page
rev 1534 : 8159495: Fix index offsets
8140530: Creating a VolatileImage with size 0,0 results in no longer working g2d.drawString
Reviewed-by: prr, psadhukhan
*** 421,430 ****
--- 421,439 ----
if (drawable != (jlong)0) {
/* Double-buffering */
xsdo->drawable = drawable;
xsdo->isPixmap = JNI_FALSE;
} else {
+ /*
+ * width , height must be nonzero otherwise XCreatePixmap
+ * generates BadValue in error_handler
+ */
+ if (width <= 0 || height <= 0 || width > 32767 || height > 32767) {
+ JNU_ThrowOutOfMemoryError(env,
+ "Can't create offscreen surface");
+ return JNI_FALSE;
+ }
xsdo->isPixmap = JNI_TRUE;
/* REMIND: workaround for bug 4420220 on pgx32 boards:
don't use DGA with pixmaps unless USE_DGA_PIXMAPS is set.
*/
xsdo->dgaAvailable = useDGAWithPixmaps;
< prev index next >