Merge branch 'master' into 'master'
Do NULL check before access See merge request simulant/GLdc!61
This commit is contained in:
commit
fc4b724cb1
|
@ -268,14 +268,14 @@ void APIENTRY glGenerateMipmapEXT(GLenum target) {
|
||||||
|
|
||||||
TextureObject* tex = _glGetBoundTexture();
|
TextureObject* tex = _glGetBoundTexture();
|
||||||
|
|
||||||
if(tex->width != tex->height) {
|
if(!tex || !tex->data || !tex->mipmapCount) {
|
||||||
fprintf(stderr, "[GL ERROR] Mipmaps cannot be supported on non-square textures\n");
|
|
||||||
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
||||||
_glKosPrintError();
|
_glKosPrintError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!tex || !tex->data || !tex->mipmapCount) {
|
if(tex->width != tex->height) {
|
||||||
|
fprintf(stderr, "[GL ERROR] Mipmaps cannot be supported on non-square textures\n");
|
||||||
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
||||||
_glKosPrintError();
|
_glKosPrintError();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user