提交 028249a5 编写于 作者: S serb

8048524: Memory leak in jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c

Reviewed-by: prr, serb
Contributed-by: NAnton Melnikov <anton.melnikov@oracle.com>
上级 668ace5d
...@@ -291,7 +291,12 @@ static ColorData *BufImg_SetupICM(JNIEnv *env, ...@@ -291,7 +291,12 @@ static ColorData *BufImg_SetupICM(JNIEnv *env,
= (*env)->GetBooleanField(env, bisdo->icm, allGrayID); = (*env)->GetBooleanField(env, bisdo->icm, allGrayID);
int *pRgb = (int *) int *pRgb = (int *)
((*env)->GetPrimitiveArrayCritical(env, bisdo->lutarray, NULL)); ((*env)->GetPrimitiveArrayCritical(env, bisdo->lutarray, NULL));
CHECK_NULL_RETURN(pRgb, (ColorData*)NULL);
if (pRgb == NULL) {
free(cData);
return (ColorData*)NULL;
}
cData->img_clr_tbl = initCubemap(pRgb, bisdo->lutsize, 32); cData->img_clr_tbl = initCubemap(pRgb, bisdo->lutsize, 32);
if (allGray == JNI_TRUE) { if (allGray == JNI_TRUE) {
initInverseGrayLut(pRgb, bisdo->lutsize, cData); initInverseGrayLut(pRgb, bisdo->lutsize, cData);
...@@ -304,7 +309,13 @@ static ColorData *BufImg_SetupICM(JNIEnv *env, ...@@ -304,7 +309,13 @@ static ColorData *BufImg_SetupICM(JNIEnv *env,
if (JNU_IsNull(env, colorData)) { if (JNU_IsNull(env, colorData)) {
jlong pData = ptr_to_jlong(cData); jlong pData = ptr_to_jlong(cData);
colorData = (*env)->NewObjectA(env, clsICMCD, initICMCDmID, (jvalue *)&pData); colorData = (*env)->NewObjectA(env, clsICMCD, initICMCDmID, (jvalue *)&pData);
JNU_CHECK_EXCEPTION_RETURN(env, (ColorData*)NULL);
if ((*env)->ExceptionCheck(env))
{
free(cData);
return (ColorData*)NULL;
}
(*env)->SetObjectField(env, bisdo->icm, colorDataID, colorData); (*env)->SetObjectField(env, bisdo->icm, colorDataID, colorData);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册