From c4566e3062a7e8afcb92efdcef1c5616cd725f90 Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Sat, 6 Jun 2020 17:45:13 -0700 Subject: [PATCH] Fix for "add object" crash in editor --- REDALERT/WIN32LIB/DrawMisc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/REDALERT/WIN32LIB/DrawMisc.cpp b/REDALERT/WIN32LIB/DrawMisc.cpp index b800ac5..37bf9e7 100644 --- a/REDALERT/WIN32LIB/DrawMisc.cpp +++ b/REDALERT/WIN32LIB/DrawMisc.cpp @@ -1921,6 +1921,9 @@ BOOL __cdecl Linear_Scale_To_Linear(void *this_object, void *dest, int src_x, in GraphicViewPortClass* viewportClass = (GraphicViewPortClass*)this_object; GraphicViewPortClass* destViewportClass = (GraphicViewPortClass*)dest; + if (destViewportClass->Get_Graphic_Buffer()->Get_Buffer() == NULL) + return false; + byte* viewportBuffer = ((byte*)viewportClass->Get_Graphic_Buffer()->Get_Buffer()); // Scale the GraphicViewPortClass to dest_x, dest_y