From ff210ed7418ef87ae8dd881be18d2b1ef99f94c5 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 18 Mar 2014 19:37:26 -0400 Subject: [PATCH] Fix serious bug in Image.cpp --- Base/src/Image.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Base/src/Image.cpp b/Base/src/Image.cpp index 0826060..ea18b36 100644 --- a/Base/src/Image.cpp +++ b/Base/src/Image.cpp @@ -93,7 +93,9 @@ Image::Image(const Image &other) , m_Height(other.m_Height) , m_Pixels(new PixelType[GetNumPixels()]) { - memcpy(m_Pixels, other.m_Pixels, GetNumPixels() * sizeof(PixelType)); + if(other.m_Pixels) { + memcpy(m_Pixels, other.m_Pixels, GetNumPixels() * sizeof(PixelType)); + } } template