Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing casts for return values of opj_malloc()/opj_calloc(). #618

Merged
merged 1 commit into from
Oct 6, 2015
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
4 changes: 2 additions & 2 deletions src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -3562,7 +3562,7 @@ static OPJ_BOOL opj_j2k_read_ppm (
return OPJ_FALSE;
}

l_cp->ppm_markers[l_Z_ppm].m_data = opj_malloc(p_header_size);
l_cp->ppm_markers[l_Z_ppm].m_data = (OPJ_BYTE *) opj_malloc(p_header_size);
if (l_cp->ppm_markers[l_Z_ppm].m_data == NULL) {
/* clean up to be done on l_cp destruction */
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPM marker\n");
Expand Down Expand Up @@ -3784,7 +3784,7 @@ static OPJ_BOOL opj_j2k_read_ppt ( opj_j2k_t *p_j2k,
return OPJ_FALSE;
}

l_tcp->ppt_markers[l_Z_ppt].m_data = opj_malloc(p_header_size);
l_tcp->ppt_markers[l_Z_ppt].m_data = (OPJ_BYTE *) opj_malloc(p_header_size);
if (l_tcp->ppt_markers[l_Z_ppt].m_data == NULL) {
/* clean up to be done on l_tcp destruction */
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPT marker\n");
Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjp2/jp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ static OPJ_BOOL opj_jp2_check_color(opj_image_t *image, opj_jp2_color_t *color,
}
}

pcol_usage = opj_calloc(nr_channels, sizeof(OPJ_BOOL));
pcol_usage = (OPJ_BOOL *) opj_calloc(nr_channels, sizeof(OPJ_BOOL));
if (!pcol_usage) {
opj_event_msg(p_manager, EVT_ERROR, "Unexpected OOM.\n");
return OPJ_FALSE;
Expand Down