From: Mathieu Malaterre Date: Thu, 8 Nov 2012 16:41:01 +0000 (+0000) Subject: [trunk] Add more test in j2k_random_tile_access X-Git-Tag: version.2.0~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f58b776b0519b8ce3527ceb5a3bf00d3bf0df93;p=openjpeg [trunk] Add more test in j2k_random_tile_access Update issue 186 --- diff --git a/tests/j2k_random_tile_access.c b/tests/j2k_random_tile_access.c index 6fb7e26a..add16a31 100644 --- a/tests/j2k_random_tile_access.c +++ b/tests/j2k_random_tile_access.c @@ -104,7 +104,7 @@ static int infile_format(const char *fname) const char *s, *magic_s; int ext_format, magic_format; unsigned char buf[12]; - unsigned int l_nb_read; + OPJ_SIZE_T l_nb_read; reader = fopen(fname, "rb"); @@ -157,6 +157,7 @@ int main(int argc, char **argv) { FILE *fsrc = NULL; + OPJ_UINT32 index; opj_dparameters_t parameters; /* decompression parameters */ opj_image_t* image = NULL; opj_stream_t *l_stream = NULL; /* Stream */ @@ -269,6 +270,10 @@ int main(int argc, char **argv) fclose(fsrc); \ return EXIT_FAILURE; \ } \ + for(index = 0; index < image->numcomps; ++index) { \ + if( image->comps[index].data == NULL ) \ + return EXIT_FAILURE; \ + } \ fprintf(stdout, "Tile %d is decoded successfully\n", tile_index); TEST_TILE(tile_ul)