From 13b46c41d2acc8c86f4d4c392963dca8a8dcd30e Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 9 May 2024 11:28:27 +0900 Subject: [PATCH] common/array: ++safety do not try memory copy if the size is 0. --- src/common/tvgArray.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/tvgArray.h b/src/common/tvgArray.h index d95df404..8178bd0e 100644 --- a/src/common/tvgArray.h +++ b/src/common/tvgArray.h @@ -61,6 +61,7 @@ struct Array void push(Array& rhs) { + if (rhs.count == 0) return; grow(rhs.count); memcpy(data + count, rhs.data, rhs.count * sizeof(T)); count += rhs.count;