- Adding max supported texture size (16K) check to KTX2 header parser

This commit is contained in:
Richard Geldreich
2026-04-20 03:15:49 -04:00
parent 2280b753ce
commit 16d7d1460d

View File

@@ -19581,6 +19581,13 @@ namespace basist
return false;
}
// Sanity check the dimensions
if ((m_header.m_pixel_width > BASISU_MAX_SUPPORTED_TEXTURE_DIMENSION) || (m_header.m_pixel_height > BASISU_MAX_SUPPORTED_TEXTURE_DIMENSION))
{
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Texture is too large\n");
return false;
}
// Face count must be 1 or 6
if ((m_header.m_face_count != 1) && (m_header.m_face_count != 6))
{