Index: core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tgt.c |
diff --git a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tgt.c b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tgt.c |
index e77adb3bb8ef695c81c7f2a0c7869bb3b8ac489d..6143c08a65905b31c4a6ca255aa9a06f4d42e58f 100644 |
--- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tgt.c |
+++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tgt.c |
@@ -57,12 +57,11 @@ opj_tgt_tree_t *opj_tgt_create(OPJ_UINT32 numleafsh, OPJ_UINT32 numleafsv) { |
OPJ_UINT32 numlvls; |
OPJ_UINT32 n; |
- tree = (opj_tgt_tree_t *) opj_malloc(sizeof(opj_tgt_tree_t)); |
+ tree = (opj_tgt_tree_t *) opj_calloc(1,sizeof(opj_tgt_tree_t)); |
if(!tree) { |
fprintf(stderr, "ERROR in tgt_create while allocating tree\n"); |
return 00; |
} |
- memset(tree,0,sizeof(opj_tgt_tree_t)); |
tree->numleafsh = numleafsh; |
tree->numleafsv = numleafsv; |
@@ -92,7 +91,6 @@ opj_tgt_tree_t *opj_tgt_create(OPJ_UINT32 numleafsh, OPJ_UINT32 numleafsv) { |
opj_free(tree); |
return 00; |
} |
- memset(tree->nodes,0,tree->numnodes * sizeof(opj_tgt_node_t)); |
tree->nodes_size = tree->numnodes * (OPJ_UINT32)sizeof(opj_tgt_node_t); |
node = tree->nodes; |