提交 3158e58e 编写于 作者: I igor

6959998: Return of SurfaceData_InitOps point not checked in all cases (parfait found these)

Reviewed-by: prr
Contributed-by: Nohair <kelly.ohair@oracle.com>
上级 6069cdd8
......@@ -111,6 +111,10 @@ Java_sun_awt_image_BufImgSurfaceData_initRaster(JNIEnv *env, jobject bisd,
{
BufImgSDOps *bisdo =
(BufImgSDOps*)SurfaceData_InitOps(env, bisd, sizeof(BufImgSDOps));
if (bisdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
bisdo->sdOps.Lock = BufImg_Lock;
bisdo->sdOps.GetRasInfo = BufImg_GetRasInfo;
bisdo->sdOps.Release = BufImg_Release;
......
......@@ -65,6 +65,11 @@ Java_sun_java2d_opengl_GLXSurfaceData_initOps(JNIEnv *env, jobject glxsd,
J2dTraceLn(J2D_TRACE_INFO, "GLXSurfaceData_initOps");
if (oglsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
if (glxsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "creating native GLX ops");
return;
......
......@@ -253,6 +253,10 @@ Java_sun_java2d_x11_XSurfaceData_initOps(JNIEnv *env, jobject xsd,
{
#ifndef HEADLESS
X11SDOps *xsdo = (X11SDOps*)SurfaceData_InitOps(env, xsd, sizeof(X11SDOps));
if (xsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
xsdo->sdOps.Lock = X11SD_Lock;
xsdo->sdOps.GetRasInfo = X11SD_GetRasInfo;
xsdo->sdOps.Unlock = X11SD_Unlock;
......
......@@ -66,6 +66,10 @@ Java_sun_java2d_opengl_WGLSurfaceData_initOps(JNIEnv *env, jobject wglsd,
J2dTraceLn(J2D_TRACE_INFO, "WGLSurfaceData_initOps");
if (oglsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
if (wglsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "creating native wgl ops");
return;
......
......@@ -363,6 +363,10 @@ Java_sun_java2d_windows_GDIWindowSurfaceData_initOps(JNIEnv *env, jobject wsd,
{
J2dTraceLn(J2D_TRACE_INFO, "GDIWindowSurfaceData_initOps");
GDIWinSDOps *wsdo = (GDIWinSDOps *)SurfaceData_InitOps(env, wsd, sizeof(GDIWinSDOps));
if (wsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
wsdo->sdOps.Lock = GDIWinSD_Lock;
wsdo->sdOps.GetRasInfo = GDIWinSD_GetRasInfo;
wsdo->sdOps.Unlock = GDIWinSD_Unlock;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册