diff options
| author | Mickael Savinaud <savmickael@users.noreply.github.com> | 2012-11-15 13:51:00 +0000 |
|---|---|---|
| committer | Mickael Savinaud <savmickael@users.noreply.github.com> | 2012-11-15 13:51:00 +0000 |
| commit | ba1682c1209bc1a58165ce8aa56c20ef9bb6f0ca (patch) | |
| tree | 928bbde3bfc03f7865d254c1514518b693c1012f | |
| parent | e212154d8d43ec583cb6dc8f963b97988a54c11d (diff) | |
[trunk] avoid memory leak in j2k_random_tile_access.c
| -rw-r--r-- | tests/j2k_random_tile_access.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/j2k_random_tile_access.c b/tests/j2k_random_tile_access.c index 23420f4e..c99555bd 100644 --- a/tests/j2k_random_tile_access.c +++ b/tests/j2k_random_tile_access.c @@ -271,8 +271,15 @@ int main(int argc, char **argv) return EXIT_FAILURE; \ } \ for(index = 0; index < image->numcomps; ++index) { \ - if( image->comps[index].data == NULL ) \ - return EXIT_FAILURE; \ + if( image->comps[index].data == NULL ){ \ + fprintf(stderr, "ERROR -> j2k_to_image: failed to decode tile %d\n", tile_index); \ + opj_stream_destroy(l_stream); \ + opj_destroy_cstr_info(&cstr_info); \ + opj_destroy_codec(l_codec); \ + opj_image_destroy(image); \ + fclose(fsrc); \ + return EXIT_FAILURE; \ + } \ } \ fprintf(stdout, "Tile %d is decoded successfully\n", tile_index); |
