summaryrefslogtreecommitdiff
path: root/src/bin/jp2/opj_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/jp2/opj_dump.c')
-rw-r--r--src/bin/jp2/opj_dump.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/jp2/opj_dump.c b/src/bin/jp2/opj_dump.c
index 6111d2ab..d2646f10 100644
--- a/src/bin/jp2/opj_dump.c
+++ b/src/bin/jp2/opj_dump.c
@@ -515,13 +515,14 @@ int main(int argc, char *argv[])
if (!dirptr) {
return EXIT_FAILURE;
}
- dirptr->filename_buf = (char*)malloc((size_t)num_images * OPJ_PATH_LEN * sizeof(
- char)); /* Stores at max 10 image file names*/
+ /* Stores at max 10 image file names*/
+ dirptr->filename_buf = (char*) calloc((size_t) num_images,
+ OPJ_PATH_LEN * sizeof(char));
if (!dirptr->filename_buf) {
free(dirptr);
return EXIT_FAILURE;
}
- dirptr->filename = (char**) malloc((size_t)num_images * sizeof(char*));
+ dirptr->filename = (char**) calloc((size_t) num_images, sizeof(char*));
if (!dirptr->filename) {
goto fails;