< prev index next >

src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c

Print this page

        

*** 331,341 **** else { h = kheight; } dkern = NULL; ! if (SAFE_TO_ALLOC_3(w, h, sizeof(mlib_d64))) { dkern = (mlib_d64 *)calloc(1, w * h * sizeof(mlib_d64)); } if (dkern == NULL) { (*env)->ReleasePrimitiveArrayCritical(env, jdata, kern, JNI_ABORT); return 0; --- 331,341 ---- else { h = kheight; } dkern = NULL; ! if (SAFE_TO_ALLOC_3(w, h, (int)sizeof(mlib_d64))) { dkern = (mlib_d64 *)calloc(1, w * h * sizeof(mlib_d64)); } if (dkern == NULL) { (*env)->ReleasePrimitiveArrayCritical(env, jdata, kern, JNI_ABORT); return 0;
*** 414,424 **** free(dkern); return 0; } kdata = NULL; ! if (SAFE_TO_ALLOC_3(w, h, sizeof(mlib_s32))) { kdata = (mlib_s32 *)malloc(w * h * sizeof(mlib_s32)); } if (kdata == NULL) { freeArray(env, srcImageP, src, sdata, dstImageP, dst, ddata); awt_freeParsedImage(srcImageP, TRUE); --- 414,424 ---- free(dkern); return 0; } kdata = NULL; ! if (SAFE_TO_ALLOC_3(w, h, (int)sizeof(mlib_s32))) { kdata = (mlib_s32 *)malloc(w * h * sizeof(mlib_s32)); } if (kdata == NULL) { freeArray(env, srcImageP, src, sdata, dstImageP, dst, ddata); awt_freeParsedImage(srcImageP, TRUE);
*** 572,582 **** else { h = kheight; } dkern = NULL; ! if (SAFE_TO_ALLOC_3(w, h, sizeof(mlib_d64))) { dkern = (mlib_d64 *)calloc(1, w * h * sizeof(mlib_d64)); } if (dkern == NULL) { (*env)->ReleasePrimitiveArrayCritical(env, jdata, kern, JNI_ABORT); return 0; --- 572,582 ---- else { h = kheight; } dkern = NULL; ! if (SAFE_TO_ALLOC_3(w, h, (int)sizeof(mlib_d64))) { dkern = (mlib_d64 *)calloc(1, w * h * sizeof(mlib_d64)); } if (dkern == NULL) { (*env)->ReleasePrimitiveArrayCritical(env, jdata, kern, JNI_ABORT); return 0;
*** 660,670 **** free(dkern); return 0; } kdata = NULL; ! if (SAFE_TO_ALLOC_3(w, h, sizeof(mlib_s32))) { kdata = (mlib_s32 *)malloc(w * h * sizeof(mlib_s32)); } if (kdata == NULL) { freeDataArray(env, srcRasterP->jdata, src, sdata, dstRasterP->jdata, dst, ddata); --- 660,670 ---- free(dkern); return 0; } kdata = NULL; ! if (SAFE_TO_ALLOC_3(w, h, (int)sizeof(mlib_s32))) { kdata = (mlib_s32 *)malloc(w * h * sizeof(mlib_s32)); } if (kdata == NULL) { freeDataArray(env, srcRasterP->jdata, src, sdata, dstRasterP->jdata, dst, ddata);
*** 1373,1389 **** if (lut_nbands > ncomponents) { lut_nbands = ncomponents; } tbl = NULL; ! if (SAFE_TO_ALLOC_2(ncomponents, sizeof(unsigned char *))) { tbl = (unsigned char **) calloc(1, ncomponents * sizeof(unsigned char *)); } jtable = NULL; ! if (SAFE_TO_ALLOC_2(lut_nbands, sizeof(LookupArrayInfo))) { jtable = (LookupArrayInfo *)malloc(lut_nbands * sizeof (LookupArrayInfo)); } if (tbl == NULL || jtable == NULL) { if (tbl != NULL) free(tbl); --- 1373,1389 ---- if (lut_nbands > ncomponents) { lut_nbands = ncomponents; } tbl = NULL; ! if (SAFE_TO_ALLOC_2(ncomponents, (int)sizeof(unsigned char *))) { tbl = (unsigned char **) calloc(1, ncomponents * sizeof(unsigned char *)); } jtable = NULL; ! if (SAFE_TO_ALLOC_2(lut_nbands, (int)sizeof(LookupArrayInfo))) { jtable = (LookupArrayInfo *)malloc(lut_nbands * sizeof (LookupArrayInfo)); } if (tbl == NULL || jtable == NULL) { if (tbl != NULL) free(tbl);
< prev index next >