From 088a1f3774834bff229492aa4d6d70c0de074c60 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 2 Apr 2020 12:16:05 +0200 Subject: [PATCH] display: fix crash with oversized p3d_LightSource array This was a regression in 89f1a0e63c Closes #897 --- panda/src/display/graphicsStateGuardian.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 5b872fdc7f..915f3161d7 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1656,6 +1656,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) if (attrib == IN_color) { if (node == nullptr) { t = LMatrix4::ident_mat(); + return; } Light *light = node->as_light(); nassertv(light != nullptr); @@ -1665,6 +1666,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) } else if (attrib == IN_ambient) { if (node == nullptr) { t = LMatrix4::ident_mat(); + return; } Light *light = node->as_light(); nassertv(light != nullptr); @@ -1679,6 +1681,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) } else if (attrib == IN_diffuse) { if (node == nullptr) { t = LMatrix4::ident_mat(); + return; } Light *light = node->as_light(); nassertv(light != nullptr); @@ -1693,6 +1696,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) } else if (attrib == IN_specular) { if (node == nullptr) { t = LMatrix4::ident_mat(); + return; } Light *light = node->as_light(); nassertv(light != nullptr);