From: mittorn Date: Sat, 19 Aug 2017 15:30:06 +0000 (+0000) Subject: Fix crash with null texture X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=ab44ab4e29101bce2bc183dc931250f258f4ce78;p=nanogl.git Fix crash with null texture --- 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;