Skip to content

Commit

Permalink
Fix resource leak in opj_j2k_encode
Browse files Browse the repository at this point in the history
Fixes #598
  • Loading branch information
mayeut committed Sep 17, 2015
1 parent a4e93c3 commit c16c917
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -9999,11 +9999,15 @@ OPJ_BOOL opj_j2k_encode(opj_j2k_t * p_j2k,
/* now copy this data into the tile component */
if (! opj_tcd_copy_tile_data(p_j2k->m_tcd,l_current_data,l_current_tile_size)) {
opj_event_msg(p_manager, EVT_ERROR, "Size mismatch between tile data and sent data." );
opj_free(l_current_data);
return OPJ_FALSE;
}
}

if (! opj_j2k_post_write_tile (p_j2k,p_stream,p_manager)) {
if (l_current_data) {
opj_free(l_current_data);
}
return OPJ_FALSE;
}
}
Expand Down

0 comments on commit c16c917

Please sign in to comment.