Skip to content

Commit

Permalink
bench_dwt: Add assert for memory allocation failure
Browse files Browse the repository at this point in the history
Fix memory allocation failure on K230
  • Loading branch information
sunyuechi authored and hleft committed Sep 19, 2024
1 parent e0e0c80 commit f6ea97a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/openjp2/bench_dwt.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void init_tilec(opj_tcd_tilecomp_t * l_tilec,
nValues = (size_t)(l_tilec->x1 - l_tilec->x0) *
(size_t)(l_tilec->y1 - l_tilec->y0);
l_tilec->data = (OPJ_INT32*) opj_malloc(sizeof(OPJ_INT32) * nValues);
assert(l_tilec->data != NULL);
for (i = 0; i < nValues; i++) {
OPJ_INT32 val = getValue((OPJ_UINT32)i);
if (irreversible) {
Expand Down

0 comments on commit f6ea97a

Please sign in to comment.