< prev index next >
src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c
Print this page
@@ -317,11 +317,11 @@
rasterP->scanlineStride = (*env)->GetIntField(env, jraster, g_BPRscanstrID);
rasterP->pixelStride = (*env)->GetIntField(env, jraster, g_BPRpixstrID);
rasterP->jdata = (*env)->GetObjectField(env, jraster, g_BPRdataID);
rasterP->type = (*env)->GetIntField(env, jraster, g_BPRtypeID);
rasterP->chanOffsets = NULL;
- if (SAFE_TO_ALLOC_2(rasterP->numDataElements, sizeof(jint))) {
+ if (SAFE_TO_ALLOC_2(rasterP->numDataElements, (int)sizeof(jint))) {
rasterP->chanOffsets =
(jint *)malloc(rasterP->numDataElements * sizeof(jint));
}
if (rasterP->chanOffsets == NULL) {
/* Out of memory */
@@ -352,11 +352,11 @@
switch (rasterP->rasterType) {
case COMPONENT_RASTER_TYPE:
case BANDED_RASTER_TYPE: // note that this routine does not support banded rasters at the moment
// get channel (data) offsets
rasterP->chanOffsets = NULL;
- if (SAFE_TO_ALLOC_2(rasterP->numDataElements, sizeof(jint))) {
+ if (SAFE_TO_ALLOC_2(rasterP->numDataElements, (int)sizeof(jint))) {
rasterP->chanOffsets =
(jint *)malloc(rasterP->numDataElements * sizeof(jint));
}
if (rasterP->chanOffsets == NULL) {
/* Out of memory */
@@ -484,11 +484,11 @@
// invalid number of components?
return -1;
}
cmP->nBits = NULL;
- if (SAFE_TO_ALLOC_2(cmP->numComponents, sizeof(jint))) {
+ if (SAFE_TO_ALLOC_2(cmP->numComponents, (int)sizeof(jint))) {
cmP->nBits = (jint *)malloc(cmP->numComponents * sizeof(jint));
}
if (cmP->nBits == NULL){
JNU_ThrowOutOfMemoryError(env, "Out of memory");
@@ -699,11 +699,11 @@
}
}
hintP->numChans = imageP->cmodel.numComponents;
hintP->colorOrder = NULL;
- if (SAFE_TO_ALLOC_2(hintP->numChans, sizeof(int))) {
+ if (SAFE_TO_ALLOC_2(hintP->numChans, (int)sizeof(int))) {
hintP->colorOrder = (int *)malloc(hintP->numChans * sizeof(int));
}
if (hintP->colorOrder == NULL) {
JNU_ThrowOutOfMemoryError(env, "Out of memory");
return -1;
< prev index next >