From 25e5c77e8001c308fada14d386cc681b154a224b Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 27 Jun 2007 03:37:19 +0000 Subject: [PATCH] protect against negative limits --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 6d779abab6..bdd50eb105 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -908,8 +908,12 @@ reset() { GLint max_elements_vertices, max_elements_indices; GLP(GetIntegerv)(GL_MAX_ELEMENTS_VERTICES, &max_elements_vertices); GLP(GetIntegerv)(GL_MAX_ELEMENTS_INDICES, &max_elements_indices); - _max_vertices_per_array = max_elements_vertices; - _max_vertices_per_primitive = max_elements_indices; + if (max_elements_vertices > 0) { + _max_vertices_per_array = max_elements_vertices; + } + if (max_elements_indices > 0) { + _max_vertices_per_primitive = max_elements_indices; + } if (GLCAT.is_debug()) { GLCAT.debug()