From e90f040208c8b3e86184db871b9499cd92ad992b Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 18 Nov 2021 11:31:15 +0900 Subject: [PATCH] common shape: fix memory access violation asan report: ../src/lib/tvgShapeImpl.h:94:15: runtime error: null pointer passed as argument 2, which is declared to never be null ../src/lib/tvgShapeImpl.h:101:15: runtime error: null pointer passed as argument 2, which is declared to never be null --- src/lib/tvgShapeImpl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/tvgShapeImpl.h b/src/lib/tvgShapeImpl.h index c887f049..32aa00ab 100644 --- a/src/lib/tvgShapeImpl.h +++ b/src/lib/tvgShapeImpl.h @@ -84,6 +84,8 @@ struct ShapePath void duplicate(const ShapePath* src) { + if (src->cmdCnt == 0 || src->ptsCnt == 0) return; + cmdCnt = src->cmdCnt; reservedCmdCnt = src->reservedCmdCnt; ptsCnt = src->ptsCnt;