8234323: NULL-check return value of SurfaceData_InitOps on macosx
Reviewed-by: clanger
This commit is contained in:
parent
8aafb0e12c
commit
227d57e548
@ -1768,6 +1768,10 @@ JNIEXPORT void JNICALL Java_sun_java2d_OSXOffScreenSurfaceData_initRaster(JNIEnv
|
||||
PRINT("Java_sun_java2d_OSXOffScreenSurfaceData_initRaster")
|
||||
|
||||
ImageSDOps* isdo = (ImageSDOps*)SurfaceData_InitOps(env, bisd, sizeof(ImageSDOps));
|
||||
if (isdo == NULL) {
|
||||
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_init(&attr);
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
|
||||
#import "PrinterSurfaceData.h"
|
||||
#import "jni_util.h"
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
|
||||
@ -87,6 +88,11 @@ JNF_COCOA_ENTER(env);
|
||||
PRINT("Java_sun_lwawt_macosx_CPrinterSurfaceData_initOps")
|
||||
|
||||
PrintSDOps *psdo = (PrintSDOps*)SurfaceData_InitOps(env, jthis, sizeof(PrintSDOps));
|
||||
if (psdo == NULL) {
|
||||
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
psdo->nsRef = (NSGraphicsContext*)jlong_to_ptr(nsRef);
|
||||
psdo->width = width;
|
||||
psdo->height = height;
|
||||
|
Loading…
x
Reference in New Issue
Block a user