From ab44ab4e29101bce2bc183dc931250f258f4ce78 Mon Sep 17 00:00:00 2001 From: mittorn Date: Sat, 19 Aug 2017 15:30:06 +0000 Subject: [PATCH] Fix crash with null texture --- nanoWrap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanoWrap.cpp b/nanoWrap.cpp index 5c5eec8..0e997fe 100644 --- a/nanoWrap.cpp +++ b/nanoWrap.cpp @@ -1281,7 +1281,7 @@ void glTexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei wid { unsigned char *data = (unsigned char*)pixels; - if( internalformat == GL_RGB && format == GL_RGBA ) // strip alpha from texture + if( pixels && internalformat == GL_RGB && format == GL_RGBA ) // strip alpha from texture { unsigned char *in = data, *out; int i = 0, size = width * height * 4; -- 2.29.2