From 078f6cd3acacacf97f3df7758a8136c24ebc7952 Mon Sep 17 00:00:00 2001 From: Rich Geldreich Date: Fri, 20 Mar 2020 02:27:33 -0400 Subject: [PATCH] Adding null pointer check here for safety --- lodepng.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lodepng.cpp b/lodepng.cpp index 60ad5ff..63adcf4 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -201,6 +201,7 @@ static void uivector_init(uivector* p) { /*returns 1 if success, 0 if failure ==> nothing done*/ static unsigned uivector_push_back(uivector* p, unsigned c) { if(!uivector_resize(p, p->size + 1)) return 0; + if (!p->data) return 0; p->data[p->size - 1] = c; return 1; }