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