f8cb4b
From 0afbdcf3e6d0d2bd2e16a0c4d513ee3cf86e460d Mon Sep 17 00:00:00 2001
f8cb4b
From: xiaoxiaoafeifei <lliangliang2007@163.com>
f8cb4b
Date: Wed, 14 Jul 2021 09:35:13 +0800
f8cb4b
Subject: [PATCH] Fix segfault in src/bin/jp2/opj_decompress.c due to
f8cb4b
 uninitialized pointer (fixes #1368) (#1369)
f8cb4b
f8cb4b
---
f8cb4b
 src/bin/jp2/opj_decompress.c | 2 +-
f8cb4b
 1 file changed, 1 insertion(+), 1 deletion(-)
f8cb4b
f8cb4b
diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c
f8cb4b
index 0e028735..18ead672 100644
f8cb4b
--- a/src/bin/jp2/opj_decompress.c
f8cb4b
+++ b/src/bin/jp2/opj_decompress.c
f8cb4b
@@ -1356,7 +1356,7 @@ int main(int argc, char **argv)
f8cb4b
         int it_image;
f8cb4b
         num_images = get_num_images(img_fol.imgdirpath);
f8cb4b
 
f8cb4b
-        dirptr = (dircnt_t*)malloc(sizeof(dircnt_t));
f8cb4b
+        dirptr = (dircnt_t*)calloc(1, sizeof(dircnt_t));
f8cb4b
         if (!dirptr) {
f8cb4b
             destroy_parameters(&parameters);
f8cb4b
             return EXIT_FAILURE;
f8cb4b
-- 
f8cb4b
2.34.1
f8cb4b