[trunk] remove some warnings detected by cppcheck

This commit is contained in:
Mickael Savinaud 2011-12-07 09:53:46 +00:00
parent bfe8b81d18
commit 90eeb25770
3 changed files with 22 additions and 2 deletions

10
CHANGES
View File

@ -5,6 +5,9 @@ What's New for OpenJPEG
! : changed ! : changed
+ : added + : added
December 7, 2011
* [mickael] remove some warnings detected by cppcheck
December 6, 2011 December 6, 2011
* [mathieu] Typos fix (Brad Hards on mailing list) * [mathieu] Typos fix (Brad Hards on mailing list)
@ -15,6 +18,13 @@ December 2, 2011
+ [mathieu] Adding CPack mechanism + [mathieu] Adding CPack mechanism
* [mathieu] remove hack with bash around kdu_expand * [mathieu] remove hack with bash around kdu_expand
December 3, 2011
* [mathieu] Doxygen fix (Brad Hards on mailing list)
December 2, 2011
+ [mathieu] Adding CPack mechanism
* [mathieu] remove hack with bash around kdu_expand
December 1, 2011 December 1, 2011
* [mickael] fix a bug during the creation of the codestream index * [mickael] fix a bug during the creation of the codestream index
* [mickael] fix a warning about a recent commit (1104) * [mickael] fix a warning about a recent commit (1104)

View File

@ -8152,8 +8152,10 @@ opj_bool j2k_decode_tiles ( opj_j2k_v2_t *p_j2k,
l_max_data_size = 1000; l_max_data_size = 1000;
/*Allocate and initialize some elements of codestrem index*/ /*Allocate and initialize some elements of codestrem index*/
if (!j2k_allocate_tile_element_cstr_index(p_j2k)) if (!j2k_allocate_tile_element_cstr_index(p_j2k)){
opj_free(l_current_data);
return OPJ_FALSE; return OPJ_FALSE;
}
while (OPJ_TRUE) { while (OPJ_TRUE) {
if (! j2k_read_tile_header( p_j2k, if (! j2k_read_tile_header( p_j2k,
@ -8176,6 +8178,7 @@ opj_bool j2k_decode_tiles ( opj_j2k_v2_t *p_j2k,
if (l_data_size > l_max_data_size) { if (l_data_size > l_max_data_size) {
l_current_data = (OPJ_BYTE*)opj_realloc(l_current_data,l_data_size); l_current_data = (OPJ_BYTE*)opj_realloc(l_current_data,l_data_size);
if (! l_current_data) { if (! l_current_data) {
opj_free(l_current_data);
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -8238,8 +8241,10 @@ opj_bool j2k_decode_one_tile ( opj_j2k_v2_t *p_j2k,
/*Allocate and initialize some elements of codestrem index if not already done*/ /*Allocate and initialize some elements of codestrem index if not already done*/
if( !p_j2k->cstr_index->tile_index) if( !p_j2k->cstr_index->tile_index)
{ {
if (!j2k_allocate_tile_element_cstr_index(p_j2k)) if (!j2k_allocate_tile_element_cstr_index(p_j2k)){
opj_free(l_current_data);
return OPJ_FALSE; return OPJ_FALSE;
}
} }
/* Move into the codestream to the first SOT used to decode the desired tile */ /* Move into the codestream to the first SOT used to decode the desired tile */
l_tile_no_to_dec = p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec; l_tile_no_to_dec = p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec;
@ -8287,6 +8292,7 @@ opj_bool j2k_decode_one_tile ( opj_j2k_v2_t *p_j2k,
if (l_data_size > l_max_data_size) { if (l_data_size > l_max_data_size) {
l_current_data = (OPJ_BYTE*)opj_realloc(l_current_data,l_data_size); l_current_data = (OPJ_BYTE*)opj_realloc(l_current_data,l_data_size);
if (! l_current_data) { if (! l_current_data) {
opj_free(l_current_data);
return OPJ_FALSE; return OPJ_FALSE;
} }

View File

@ -2047,6 +2047,10 @@ opj_bool jp2_read_header_procedure(
if (l_current_handler != 00) { if (l_current_handler != 00) {
if (l_current_data_size > l_last_data_size) { if (l_current_data_size > l_last_data_size) {
l_current_data = (unsigned char*)opj_realloc(l_current_data,l_current_data_size); l_current_data = (unsigned char*)opj_realloc(l_current_data,l_current_data_size);
if (!l_current_data){
opj_free(l_current_data);
return OPJ_FALSE;
}
l_last_data_size = l_current_data_size; l_last_data_size = l_current_data_size;
} }