From 295fc16effafb3ab9e2f39850fdd43655fb25212 Mon Sep 17 00:00:00 2001 From: Miha Lunar Date: Thu, 25 Sep 2014 20:17:23 +0200 Subject: [PATCH] added a null check, otherwise it can crash when loading an empty file --- src/nanosvg.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nanosvg.h b/src/nanosvg.h index 4ba0b8e..524edb6 100644 --- a/src/nanosvg.h +++ b/src/nanosvg.h @@ -2380,6 +2380,7 @@ static void nsvg__imageBounds(NSVGparser* p, float* bounds) { NSVGshape* shape; shape = p->image->shapes; + if (shape == NULL) return; bounds[0] = shape->bounds[0]; bounds[1] = shape->bounds[1]; bounds[2] = shape->bounds[2];