summaryrefslogtreecommitdiff
path: root/src/lib/openjp2/sparse_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/openjp2/sparse_array.c')
-rw-r--r--src/lib/openjp2/sparse_array.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/openjp2/sparse_array.c b/src/lib/openjp2/sparse_array.c
index 6a2d8d43..67212d28 100644
--- a/src/lib/openjp2/sparse_array.c
+++ b/src/lib/openjp2/sparse_array.c
@@ -56,7 +56,8 @@ opj_sparse_array_int32_t* opj_sparse_array_int32_create(OPJ_UINT32 width,
return NULL;
}
- sa = opj_calloc(1, sizeof(opj_sparse_array_int32_t));
+ sa = (opj_sparse_array_int32_t*) opj_calloc(1,
+ sizeof(opj_sparse_array_int32_t));
sa->width = width;
sa->height = height;
sa->block_width = block_width;
@@ -67,8 +68,8 @@ opj_sparse_array_int32_t* opj_sparse_array_int32_create(OPJ_UINT32 width,
opj_free(sa);
return NULL;
}
- sa->data_blocks = opj_calloc(sizeof(OPJ_INT32*),
- sa->block_count_hor * sa->block_count_ver);
+ sa->data_blocks = (OPJ_INT32**) opj_calloc(sizeof(OPJ_INT32*),
+ sa->block_count_hor * sa->block_count_ver);
if (sa->data_blocks == NULL) {
opj_free(sa);
return NULL;
@@ -232,8 +233,8 @@ static OPJ_BOOL opj_sparse_array_int32_read_or_write(
}
} else {
if (src_block == NULL) {
- src_block = opj_calloc(1,
- sa->block_width * sa->block_height * sizeof(OPJ_INT32));
+ src_block = (OPJ_INT32*) opj_calloc(1,
+ sa->block_width * sa->block_height * sizeof(OPJ_INT32));
if (src_block == NULL) {
return OPJ_FALSE;
}