Fix some coverity warnings

This commit is contained in:
mayeut 2016-04-30 12:15:22 +02:00
parent f40a2ff2ad
commit cd77b6003b
2 changed files with 7 additions and 11 deletions

View File

@ -9343,6 +9343,7 @@ void j2k_dump (opj_j2k_t* p_j2k, OPJ_INT32 flag, FILE* out_stream)
/* Dump the codestream info from main header */
if (flag & OPJ_J2K_MH_INFO){
if (p_j2k->m_private_image)
opj_j2k_dump_MH_info(p_j2k, out_stream);
}
/* Dump all tile/codestream info */
@ -9350,11 +9351,13 @@ void j2k_dump (opj_j2k_t* p_j2k, OPJ_INT32 flag, FILE* out_stream)
OPJ_UINT32 l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;
OPJ_UINT32 i;
opj_tcp_t * l_tcp = p_j2k->m_cp.tcps;
if (p_j2k->m_private_image) {
for (i=0;i<l_nb_tiles;++i) {
opj_j2k_dump_tile_info( l_tcp,(OPJ_INT32)p_j2k->m_private_image->numcomps, out_stream);
++l_tcp;
}
}
}
/* Dump the codestream info of the current tile */
if (flag & OPJ_J2K_TH_INFO){

View File

@ -486,7 +486,6 @@ OPJ_BOOL opj_tcd_rateallocate( opj_tcd_t *tcd,
for (layno = 0; layno < tcd_tcp->numlayers; layno++) {
OPJ_FLOAT64 lo = min;
OPJ_FLOAT64 hi = max;
OPJ_BOOL success = OPJ_FALSE;
OPJ_UINT32 maxlen = tcd_tcp->rates[layno] > 0.0f ? opj_uint_min(((OPJ_UINT32) ceil(tcd_tcp->rates[layno])), len) : len;
OPJ_FLOAT64 goodthresh = 0;
OPJ_FLOAT64 stable_thresh = 0;
@ -559,19 +558,13 @@ OPJ_BOOL opj_tcd_rateallocate( opj_tcd_t *tcd,
}
}
success = OPJ_TRUE;
goodthresh = stable_thresh == 0? thresh : stable_thresh;
opj_t2_destroy(t2);
} else {
success = OPJ_TRUE;
goodthresh = min;
}
if (!success) {
return OPJ_FALSE;
}
if(cstr_info) { /* Threshold for Marcela Index */
cstr_info->tile[tcd->tcd_tileno].thresh[layno] = goodthresh;
}