From f6ea97aa3688a7e71ff16a1a674940f8b9c55018 Mon Sep 17 00:00:00 2001 From: sunyuechi Date: Thu, 19 Sep 2024 12:00:35 +0800 Subject: [PATCH] bench_dwt: Add assert for memory allocation failure Fix memory allocation failure on K230 --- src/lib/openjp2/bench_dwt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/openjp2/bench_dwt.c b/src/lib/openjp2/bench_dwt.c index 4f2ea9fbd..ee70c4054 100644 --- a/src/lib/openjp2/bench_dwt.c +++ b/src/lib/openjp2/bench_dwt.c @@ -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) {