[trunk] rework code from r2463. Really there has been some code duplication from r2413

Thanks to John Rogers (oracle.com) for report
This commit is contained in:
Mathieu Malaterre 2014-03-14 15:06:20 +00:00
parent 5e91877636
commit 15863e7170
1 changed files with 0 additions and 15 deletions

View File

@ -1053,11 +1053,6 @@ OPJ_BOOL opj_jp2_read_cmap( opj_jp2_t * jp2,
return OPJ_FALSE; return OPJ_FALSE;
} }
if (p_cmap_header_size < (OPJ_UINT32)nr_channels * 4) {
opj_event_msg(p_manager, EVT_ERROR, "Insufficient data for CMAP box.\n");
return OPJ_FALSE;
}
cmap = (opj_jp2_cmap_comp_t*) opj_malloc(nr_channels * sizeof(opj_jp2_cmap_comp_t)); cmap = (opj_jp2_cmap_comp_t*) opj_malloc(nr_channels * sizeof(opj_jp2_cmap_comp_t));
if (!cmap) if (!cmap)
return OPJ_FALSE; return OPJ_FALSE;
@ -1155,11 +1150,6 @@ OPJ_BOOL opj_jp2_read_cdef( opj_jp2_t * jp2,
return OPJ_FALSE; return OPJ_FALSE;
} }
if (p_cdef_header_size < 2) {
opj_event_msg(p_manager, EVT_ERROR, "Insufficient data for CDEF box.\n");
return OPJ_FALSE;
}
opj_read_bytes(p_cdef_header_data,&l_value ,2); /* N */ opj_read_bytes(p_cdef_header_data,&l_value ,2); /* N */
p_cdef_header_data+= 2; p_cdef_header_data+= 2;
@ -1173,11 +1163,6 @@ OPJ_BOOL opj_jp2_read_cdef( opj_jp2_t * jp2,
return OPJ_FALSE; return OPJ_FALSE;
} }
if (p_cdef_header_size < 2 + (OPJ_UINT32)(OPJ_UINT16)l_value * 6) {
opj_event_msg(p_manager, EVT_ERROR, "Insufficient data for CDEF box.\n");
return OPJ_FALSE;
}
cdef_info = (opj_jp2_cdef_info_t*) opj_malloc(l_value * sizeof(opj_jp2_cdef_info_t)); cdef_info = (opj_jp2_cdef_info_t*) opj_malloc(l_value * sizeof(opj_jp2_cdef_info_t));
if (!cdef_info) if (!cdef_info)
return OPJ_FALSE; return OPJ_FALSE;