[trunk] remove warnings raised by vs11-beta analyzer
This commit is contained in:
parent
94880d8f36
commit
0e3c467a5b
|
@ -809,6 +809,7 @@ void opj_j2k_update_tlm (opj_j2k_t * p_j2k, OPJ_UINT32 p_tile_part_size )
|
||||||
*
|
*
|
||||||
* @param p_tile_no the tile to output
|
* @param p_tile_no the tile to output
|
||||||
* @param p_comp_no the component to output
|
* @param p_comp_no the component to output
|
||||||
|
* @param nb_comps the number of components
|
||||||
* @param p_stream the stream to write data to.
|
* @param p_stream the stream to write data to.
|
||||||
* @param p_j2k J2K codec.
|
* @param p_j2k J2K codec.
|
||||||
* @param p_manager the user event manager.
|
* @param p_manager the user event manager.
|
||||||
|
@ -816,6 +817,7 @@ void opj_j2k_update_tlm (opj_j2k_t * p_j2k, OPJ_UINT32 p_tile_part_size )
|
||||||
static opj_bool opj_j2k_write_rgn( opj_j2k_t *p_j2k,
|
static opj_bool opj_j2k_write_rgn( opj_j2k_t *p_j2k,
|
||||||
OPJ_UINT32 p_tile_no,
|
OPJ_UINT32 p_tile_no,
|
||||||
OPJ_UINT32 p_comp_no,
|
OPJ_UINT32 p_comp_no,
|
||||||
|
OPJ_UINT32 nb_comps,
|
||||||
opj_stream_private_t *p_stream,
|
opj_stream_private_t *p_stream,
|
||||||
opj_event_mgr_t * p_manager );
|
opj_event_mgr_t * p_manager );
|
||||||
|
|
||||||
|
@ -4262,14 +4264,13 @@ opj_bool opj_j2k_read_sod (opj_j2k_t *p_j2k,
|
||||||
opj_bool opj_j2k_write_rgn(opj_j2k_t *p_j2k,
|
opj_bool opj_j2k_write_rgn(opj_j2k_t *p_j2k,
|
||||||
OPJ_UINT32 p_tile_no,
|
OPJ_UINT32 p_tile_no,
|
||||||
OPJ_UINT32 p_comp_no,
|
OPJ_UINT32 p_comp_no,
|
||||||
|
OPJ_UINT32 nb_comps,
|
||||||
opj_stream_private_t *p_stream,
|
opj_stream_private_t *p_stream,
|
||||||
opj_event_mgr_t * p_manager
|
opj_event_mgr_t * p_manager
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
OPJ_BYTE * l_current_data = 00;
|
OPJ_BYTE * l_current_data = 00;
|
||||||
OPJ_UINT32 l_nb_comp;
|
|
||||||
OPJ_UINT32 l_rgn_size;
|
OPJ_UINT32 l_rgn_size;
|
||||||
opj_image_t *l_image = 00;
|
|
||||||
opj_cp_t *l_cp = 00;
|
opj_cp_t *l_cp = 00;
|
||||||
opj_tcp_t *l_tcp = 00;
|
opj_tcp_t *l_tcp = 00;
|
||||||
opj_tccp_t *l_tccp = 00;
|
opj_tccp_t *l_tccp = 00;
|
||||||
|
@ -4284,9 +4285,7 @@ opj_bool opj_j2k_read_sod (opj_j2k_t *p_j2k,
|
||||||
l_tcp = &l_cp->tcps[p_tile_no];
|
l_tcp = &l_cp->tcps[p_tile_no];
|
||||||
l_tccp = &l_tcp->tccps[p_comp_no];
|
l_tccp = &l_tcp->tccps[p_comp_no];
|
||||||
|
|
||||||
l_nb_comp = l_image->numcomps;
|
if (nb_comps <= 256) {
|
||||||
|
|
||||||
if (l_nb_comp <= 256) {
|
|
||||||
l_comp_room = 1;
|
l_comp_room = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -4747,7 +4746,7 @@ opj_bool opj_j2k_write_regions( opj_j2k_t *p_j2k,
|
||||||
for (compno = 0; compno < p_j2k->m_private_image->numcomps; ++compno) {
|
for (compno = 0; compno < p_j2k->m_private_image->numcomps; ++compno) {
|
||||||
if (l_tccp->roishift) {
|
if (l_tccp->roishift) {
|
||||||
|
|
||||||
if (! opj_j2k_write_rgn(p_j2k,0,compno,p_stream,p_manager)) {
|
if (! opj_j2k_write_rgn(p_j2k,0,compno,p_j2k->m_private_image->numcomps,p_stream,p_manager)) {
|
||||||
return OPJ_FALSE;
|
return OPJ_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8453,6 +8452,8 @@ opj_codestream_info_v2_t* j2k_get_cstr_info(opj_j2k_t* p_j2k)
|
||||||
OPJ_UINT32 numcomps = p_j2k->m_private_image->numcomps;
|
OPJ_UINT32 numcomps = p_j2k->m_private_image->numcomps;
|
||||||
opj_tcp_t *l_default_tile;
|
opj_tcp_t *l_default_tile;
|
||||||
opj_codestream_info_v2_t* cstr_info = (opj_codestream_info_v2_t*) opj_calloc(1,sizeof(opj_codestream_info_v2_t));
|
opj_codestream_info_v2_t* cstr_info = (opj_codestream_info_v2_t*) opj_calloc(1,sizeof(opj_codestream_info_v2_t));
|
||||||
|
if (!cstr_info)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
cstr_info->nbcomps = p_j2k->m_private_image->numcomps;
|
cstr_info->nbcomps = p_j2k->m_private_image->numcomps;
|
||||||
|
|
||||||
|
@ -8473,6 +8474,11 @@ opj_codestream_info_v2_t* j2k_get_cstr_info(opj_j2k_t* p_j2k)
|
||||||
cstr_info->m_default_tile_info.mct = l_default_tile->mct;
|
cstr_info->m_default_tile_info.mct = l_default_tile->mct;
|
||||||
|
|
||||||
cstr_info->m_default_tile_info.tccp_info = (opj_tccp_info_t*) opj_calloc(cstr_info->nbcomps, sizeof(opj_tccp_info_t));
|
cstr_info->m_default_tile_info.tccp_info = (opj_tccp_info_t*) opj_calloc(cstr_info->nbcomps, sizeof(opj_tccp_info_t));
|
||||||
|
if (!cstr_info->m_default_tile_info.tccp_info)
|
||||||
|
{
|
||||||
|
opj_destroy_cstr_info(&cstr_info);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
for (compno = 0; compno < numcomps; compno++) {
|
for (compno = 0; compno < numcomps; compno++) {
|
||||||
opj_tccp_t *l_tccp = &(l_default_tile->tccps[compno]);
|
opj_tccp_t *l_tccp = &(l_default_tile->tccps[compno]);
|
||||||
|
|
|
@ -842,10 +842,31 @@ opj_bool opj_jp2_read_pclr( opj_jp2_t *jp2,
|
||||||
nr_channels = (OPJ_UINT16) l_value;
|
nr_channels = (OPJ_UINT16) l_value;
|
||||||
|
|
||||||
entries = (OPJ_UINT32*) opj_malloc(nr_channels * nr_entries * sizeof(OPJ_UINT32));
|
entries = (OPJ_UINT32*) opj_malloc(nr_channels * nr_entries * sizeof(OPJ_UINT32));
|
||||||
|
if (!entries)
|
||||||
|
return OPJ_FALSE;
|
||||||
channel_size = (OPJ_BYTE*) opj_malloc(nr_channels);
|
channel_size = (OPJ_BYTE*) opj_malloc(nr_channels);
|
||||||
|
if (!channel_size)
|
||||||
|
{
|
||||||
|
opj_free(entries);
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
channel_sign = (OPJ_BYTE*) opj_malloc(nr_channels);
|
channel_sign = (OPJ_BYTE*) opj_malloc(nr_channels);
|
||||||
|
if (!channel_sign)
|
||||||
|
{
|
||||||
|
opj_free(entries);
|
||||||
|
opj_free(channel_size);
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
jp2_pclr = (opj_jp2_pclr_t*)opj_malloc(sizeof(opj_jp2_pclr_t));
|
jp2_pclr = (opj_jp2_pclr_t*)opj_malloc(sizeof(opj_jp2_pclr_t));
|
||||||
|
if (!jp2_pclr)
|
||||||
|
{
|
||||||
|
opj_free(entries);
|
||||||
|
opj_free(channel_size);
|
||||||
|
opj_free(channel_sign);
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
jp2_pclr->channel_sign = channel_sign;
|
jp2_pclr->channel_sign = channel_sign;
|
||||||
jp2_pclr->channel_size = channel_size;
|
jp2_pclr->channel_size = channel_size;
|
||||||
jp2_pclr->entries = entries;
|
jp2_pclr->entries = entries;
|
||||||
|
@ -909,6 +930,9 @@ opj_bool opj_jp2_read_cmap( opj_jp2_t * jp2,
|
||||||
|
|
||||||
nr_channels = jp2->color.jp2_pclr->nr_channels;
|
nr_channels = jp2->color.jp2_pclr->nr_channels;
|
||||||
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)
|
||||||
|
return OPJ_FALSE;
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < nr_channels; ++i) {
|
for(i = 0; i < nr_channels; ++i) {
|
||||||
opj_read_bytes(p_cmap_header_data, &l_value, 2); /* CMP^i */
|
opj_read_bytes(p_cmap_header_data, &l_value, 2); /* CMP^i */
|
||||||
|
@ -993,8 +1017,15 @@ opj_bool opj_jp2_read_cdef( opj_jp2_t * jp2,
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
return OPJ_FALSE;
|
||||||
|
|
||||||
jp2->color.jp2_cdef = (opj_jp2_cdef_t*)opj_malloc(sizeof(opj_jp2_cdef_t));
|
jp2->color.jp2_cdef = (opj_jp2_cdef_t*)opj_malloc(sizeof(opj_jp2_cdef_t));
|
||||||
|
if(!jp2->color.jp2_cdef)
|
||||||
|
{
|
||||||
|
opj_free(cdef_info);
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
jp2->color.jp2_cdef->info = cdef_info;
|
jp2->color.jp2_cdef->info = cdef_info;
|
||||||
jp2->color.jp2_cdef->n = (OPJ_UINT16) l_value;
|
jp2->color.jp2_cdef->n = (OPJ_UINT16) l_value;
|
||||||
|
|
||||||
|
@ -1066,7 +1097,11 @@ opj_bool opj_jp2_read_colr( opj_jp2_t *jp2,
|
||||||
|
|
||||||
jp2->color.icc_profile_len = icc_len;
|
jp2->color.icc_profile_len = icc_len;
|
||||||
jp2->color.icc_profile_buf = (OPJ_BYTE*) opj_malloc(icc_len);
|
jp2->color.icc_profile_buf = (OPJ_BYTE*) opj_malloc(icc_len);
|
||||||
|
if (!jp2->color.icc_profile_buf)
|
||||||
|
{
|
||||||
|
jp2->color.icc_profile_len = 0;
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
memset(jp2->color.icc_profile_buf, 0, icc_len * sizeof(OPJ_BYTE));
|
memset(jp2->color.icc_profile_buf, 0, icc_len * sizeof(OPJ_BYTE));
|
||||||
|
|
||||||
for (it_icc_value = 0; it_icc_value < icc_len; ++it_icc_value)
|
for (it_icc_value = 0; it_icc_value < icc_len; ++it_icc_value)
|
||||||
|
@ -1396,12 +1431,23 @@ void opj_jp2_setup_encoder( opj_jp2_t *jp2,
|
||||||
jp2->minversion = 0; /* MinV */
|
jp2->minversion = 0; /* MinV */
|
||||||
jp2->numcl = 1;
|
jp2->numcl = 1;
|
||||||
jp2->cl = (OPJ_UINT32*) opj_malloc(jp2->numcl * sizeof(OPJ_UINT32));
|
jp2->cl = (OPJ_UINT32*) opj_malloc(jp2->numcl * sizeof(OPJ_UINT32));
|
||||||
|
if (!jp2->cl){
|
||||||
|
jp2->cl = NULL;
|
||||||
|
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory when setup the JP2 encoder\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
jp2->cl[0] = JP2_JP2; /* CL0 : JP2 */
|
jp2->cl[0] = JP2_JP2; /* CL0 : JP2 */
|
||||||
|
|
||||||
/* Image Header box */
|
/* Image Header box */
|
||||||
|
|
||||||
jp2->numcomps = image->numcomps; /* NC */
|
jp2->numcomps = image->numcomps; /* NC */
|
||||||
jp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t));
|
jp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t));
|
||||||
|
if (!jp2->comps) {
|
||||||
|
jp2->comps = NULL;
|
||||||
|
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory when setup the JP2 encoder\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jp2->h = image->y1 - image->y0; /* HEIGHT */
|
jp2->h = image->y1 - image->y0; /* HEIGHT */
|
||||||
jp2->w = image->x1 - image->x0; /* WIDTH */
|
jp2->w = image->x1 - image->x0; /* WIDTH */
|
||||||
/* BPC */
|
/* BPC */
|
||||||
|
|
Loading…
Reference in New Issue