[trunk] solve a potential bug when we test the realloc

This commit is contained in:
Mickael Savinaud 2012-11-15 16:37:57 +00:00
parent 8eb481b6c6
commit c3c59b010b
1 changed files with 1 additions and 1 deletions

View File

@ -170,7 +170,7 @@ opj_tgt_tree_t *opj_tgt_init(opj_tgt_tree_t * p_tree,OPJ_UINT32 p_num_leafs_h, O
if (l_node_size > p_tree->nodes_size) {
opj_tgt_node_t* new_nodes = (opj_tgt_node_t*) opj_realloc(p_tree->nodes, l_node_size);
if (! p_tree->nodes) {
if (! new_nodes) {
fprintf(stderr, "ERROR Not enough memory to reinitialize the tag tree\n");
opj_tgt_destroy(p_tree);
return 00;