From 314e9ee4db4de6a5125ade5d3b1a1f2e06b98efb Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 2 Dec 2014 01:31:45 +0000 Subject: [PATCH] Handle NULL array of textures in glBindTextures --- renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp index e6af201bf..31fdad0a0 100644 --- a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp @@ -194,7 +194,7 @@ bool WrappedOpenGL::Serialise_glBindTextures(GLuint first, GLsizei count, const for(int32_t i=0; i < Count; i++) { - SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(TextureRes(GetCtx(), textures[i]))); + SERIALISE_ELEMENT(ResourceId, id, textures && textures[i] ? GetResourceManager()->GetID(TextureRes(GetCtx(), textures[i])) : ResourceId()); if(m_State <= EXECUTING) { @@ -239,7 +239,7 @@ void WrappedOpenGL::glBindTextures(GLuint first, GLsizei count, const GLuint *te { for(GLsizei i=0; i < count; i++) { - if(textures[i] == 0) + if(textures == NULL || textures[i] == 0) m_TextureRecord[first + i] = 0; else m_TextureRecord[first + i] = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), textures[i]));