From 3dbf7c9de61eedcad342092c7bc5e3ed604278c4 Mon Sep 17 00:00:00 2001 From: cutealien Date: Thu, 30 Jul 2015 21:53:21 +0000 Subject: [PATCH] Return reference to a local static instead of a reference to 0 in an error cases (was undefined c++). Thx @floriang for reporting at http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=50877 git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5113 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/COGLES2Driver.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/Irrlicht/COGLES2Driver.cpp b/source/Irrlicht/COGLES2Driver.cpp index 474b3e5a..5bd91f5b 100644 --- a/source/Irrlicht/COGLES2Driver.cpp +++ b/source/Irrlicht/COGLES2Driver.cpp @@ -2689,7 +2689,11 @@ bool COGLES2Driver::endScene() if (index < UserClipPlane.size()) return UserClipPlane[index].Plane; else - return *((core::plane3df*)0); + { + _IRR_DEBUG_BREAK_IF(true) // invalid index + static const core::plane3df dummy; + return dummy; + } } core::dimension2du COGLES2Driver::getMaxTextureSize() const