DEADSOFTWARE

Fix crash with null texture
authormittorn <mittorn@sibmail.com>
Sat, 19 Aug 2017 15:30:06 +0000 (15:30 +0000)
committermittorn <mittorn@sibmail.com>
Sat, 19 Aug 2017 15:30:06 +0000 (15:30 +0000)
nanoWrap.cpp

index 5c5eec805314a6a8deb061897e67b88e7b0e7d54..0e997fe783b5cfd83a7d7b6112111472c25d3f6b 100644 (file)
@@ -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;