8159495: Fix Index Offsets

Reviewed-by: flar, serb, mschoene
This commit is contained in:
Phil Race 2016-07-05 10:29:31 -07:00
parent bb951288f4
commit 573f0c765c
4 changed files with 17 additions and 8 deletions

View File

@ -102,10 +102,13 @@ public abstract class X11SurfaceDataProxy extends SurfaceDataProxy
int w, int h)
{
if (cachedData == null) {
// Bitmask will be created lazily during the blit phase
cachedData = X11SurfaceData.createData(x11gc, w, h,
x11gc.getColorModel(),
null, 0, getTransparency());
try {
// Bitmask will be created lazily during the blit phase
cachedData = X11SurfaceData.createData(x11gc, w, h,
x11gc.getColorModel(),
null, 0, getTransparency());
} catch (OutOfMemoryError oome) {
}
}
return cachedData;
}

View File

@ -138,6 +138,9 @@ public class XRPMBlitLoops {
vImg = (SunVolatileImage) dst.getGraphicsConfig().createCompatibleVolatileImage(w, h, src.getTransparency());
vImg.setAccelerationPriority(1.0f);
if (!(vImg.getDestSurface() instanceof XRSurfaceData)) {
throw new InvalidPipeException("Could not create XRSurfaceData");
}
if (src.getTransparency() == SurfaceData.OPAQUE) {
rgbTmpPM = new WeakReference<SunVolatileImage>(vImg);
} else {

View File

@ -59,9 +59,12 @@ public class XRSurfaceDataProxy extends SurfaceDataProxy implements Transparency
public SurfaceData validateSurfaceData(SurfaceData srcData,
SurfaceData cachedData, int w, int h) {
if (cachedData == null) {
cachedData = XRSurfaceData.createData(xrgc, w, h,
xrgc.getColorModel(), null, 0,
getTransparency(), true);
try {
cachedData = XRSurfaceData.createData(xrgc, w, h,
xrgc.getColorModel(), null, 0,
getTransparency(), true);
} catch (OutOfMemoryError oome) {
}
}
return cachedData;
}

View File

@ -441,7 +441,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
* width , height must be nonzero otherwise XCreatePixmap
* generates BadValue in error_handler
*/
if (width <= 0 || height <= 0) {
if (width <= 0 || height <= 0 || width > 32767 || height > 32767) {
JNU_ThrowOutOfMemoryError(env,
"Can't create offscreen surface");
return JNI_FALSE;