diff options
| author | Yuan <zodf0055980@gmail.com> | 2022-05-31 17:55:12 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-31 11:55:12 +0200 |
| commit | 0535bfc3b7d5cd6fc73a7d4a6749a338fc5d7703 (patch) | |
| tree | d35083e7f687970c7020200fd4e6d72d973a3364 /src/lib | |
| parent | 52927287402a9f7353de8854c88f931051211e2f (diff) | |
HT_DEC: Fix opj_t1_allocate_buffers malloc size error (#1426) (fixes #1413)
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/openjp2/ht_dec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/openjp2/ht_dec.c b/src/lib/openjp2/ht_dec.c index e2f3afd6..a803d1bb 100644 --- a/src/lib/openjp2/ht_dec.c +++ b/src/lib/openjp2/ht_dec.c @@ -1063,7 +1063,7 @@ static OPJ_BOOL opj_t1_allocate_buffers( if (flagssize > t1->flagssize) { opj_aligned_free(t1->flags); - t1->flags = (opj_flag_t*) opj_aligned_malloc(flagssize); + t1->flags = (opj_flag_t*) opj_aligned_malloc(flagssize * sizeof(opj_flag_t)); if (!t1->flags) { /* FIXME event manager error callback */ return OPJ_FALSE; @@ -1071,7 +1071,7 @@ static OPJ_BOOL opj_t1_allocate_buffers( } t1->flagssize = flagssize; - memset(t1->flags, 0, flagssize); + memset(t1->flags, 0, flagssize * sizeof(opj_flag_t)); } t1->w = w; |
