glgsg: Fix regression defining null mipmap levels of cube map

Fixes #1189
This commit is contained in:
rdb 2022-11-05 15:52:27 +01:00
parent b8c53be8fd
commit 523e1bcbb8

View File

@ -14242,7 +14242,8 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload,
size_t page_size = tex->get_ram_mipmap_page_size(n);
for (int z = 0; z < 6; ++z) {
GLenum page_target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + z;
const unsigned char *page_ptr = image_ptr + page_size * z;
const unsigned char *page_ptr =
(image_ptr != nullptr) ? image_ptr + page_size * z : nullptr;
if (image_compression == Texture::CM_off) {
glTexImage2D(page_target, n - mipmap_bias, internal_format,