From 5a865e6377bcdc40bb00a6ded5f8736a8133b731 Mon Sep 17 00:00:00 2001 From: pchelko Date: Mon, 28 Apr 2014 19:51:03 +0400 Subject: [PATCH] 8030788: [Parfait] warnings from b119 for jdk/src/share/native/sun/awt/medialib: JNI exception pending Reviewed-by: serb, prr --- .../native/sun/awt/medialib/awt_ImagingLib.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/share/native/sun/awt/medialib/awt_ImagingLib.c b/src/share/native/sun/awt/medialib/awt_ImagingLib.c index 0b3422947..1ed87f7b5 100644 --- a/src/share/native/sun/awt/medialib/awt_ImagingLib.c +++ b/src/share/native/sun/awt/medialib/awt_ImagingLib.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1151,6 +1151,7 @@ fprintf(stderr,"Flags : %d\n",dst->flags); if (ddata == NULL) { /* Need to store it back into the array */ if (storeRasterArray(env, srcRasterP, dstRasterP, dst) < 0) { + (*env)->ExceptionClear(env); // Could not store the array, try another way retStatus = setPixelsFormMlibImage(env, dstRasterP, dst); } } @@ -2062,6 +2063,7 @@ cvtCustomToDefault(JNIEnv *env, BufImageS_t *imageP, int component, jpixels = (*env)->NewIntArray(env, nbytes); if (JNU_IsNull(env, jpixels)) { + (*env)->ExceptionClear(env); JNU_ThrowOutOfMemoryError(env, "Out of Memory"); return -1; } @@ -2127,6 +2129,7 @@ cvtDefaultToCustom(JNIEnv *env, BufImageS_t *imageP, int component, jpixels = (*env)->NewIntArray(env, nbytes); if (JNU_IsNull(env, jpixels)) { + (*env)->ExceptionClear(env); JNU_ThrowOutOfMemoryError(env, "Out of Memory"); return -1; } @@ -2823,21 +2826,14 @@ static int expandICM(JNIEnv *env, BufImageS_t *imageP, unsigned int *mDataP) /* Need to grab the lookup tables. Right now only bytes */ rgb = (int *) (*env)->GetPrimitiveArrayCritical(env, cmP->jrgb, NULL); + CHECK_NULL_RETURN(rgb, -1); /* Interleaved with shared data */ dataP = (void *) (*env)->GetPrimitiveArrayCritical(env, rasterP->jdata, NULL); - if (rgb == NULL || dataP == NULL) { + if (dataP == NULL) { /* Release the lookup tables */ - if (rgb) { - (*env)->ReleasePrimitiveArrayCritical(env, cmP->jrgb, rgb, - JNI_ABORT); - } - if (dataP) { - (*env)->ReleasePrimitiveArrayCritical(env, - rasterP->jdata, dataP, - JNI_ABORT); - } + (*env)->ReleasePrimitiveArrayCritical(env, cmP->jrgb, rgb, JNI_ABORT); return -1; } -- GitLab