Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ static OPJ_BOOL opj_j2k_check_poc_val(const opj_poc_t *p_pocs,

assert(p_nb_pocs > 0);

packet_array = (OPJ_UINT32*) opj_calloc(step_l * p_num_layers,
packet_array = (OPJ_UINT32*) opj_calloc((size_t)step_l * p_num_layers,
sizeof(OPJ_UINT32));
if (packet_array == 00) {
opj_event_msg(p_manager, EVT_ERROR,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/openjp2/jp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,9 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
}

max = image->numcomps;
for (i = 0; i < max; ++i) {
if (old_comps[i].data) {
opj_image_data_free(old_comps[i].data);
for (j = 0; j < max; ++j) {
if (old_comps[j].data) {
opj_image_data_free(old_comps[j].data);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjp2/mct.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void opj_calculate_norms(OPJ_FLOAT64 * pNorms,
for (j = 0; j < pNbComps; ++j) {
lCurrentValue = lMatrix[lIndex];
lIndex += pNbComps;
lNorms[i] += lCurrentValue * lCurrentValue;
lNorms[i] += (OPJ_FLOAT64) lCurrentValue * lCurrentValue;
}
lNorms[i] = sqrt(lNorms[i]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/openjp2/sparse_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ opj_sparse_array_int32_t* opj_sparse_array_int32_create(OPJ_UINT32 width,
return NULL;
}
sa->data_blocks = (OPJ_INT32**) opj_calloc(sizeof(OPJ_INT32*),
sa->block_count_hor * sa->block_count_ver);
(size_t) sa->block_count_hor * sa->block_count_ver);
if (sa->data_blocks == NULL) {
opj_free(sa);
return NULL;
Expand Down Expand Up @@ -235,7 +235,7 @@ static OPJ_BOOL opj_sparse_array_int32_read_or_write(
} else {
if (src_block == NULL) {
src_block = (OPJ_INT32*) opj_calloc(1,
sa->block_width * sa->block_height * sizeof(OPJ_INT32));
(size_t) sa->block_width * sa->block_height * sizeof(OPJ_INT32));
if (src_block == NULL) {
return OPJ_FALSE;
}
Expand Down