Browse Source

engine: imagelib: img_ktx2: don't allow to load images with no mip levels

pull/2/head
Alibek Omarov 12 months ago
parent
commit
a675806c91
  1. 6
      engine/common/imagelib/img_ktx2.c

6
engine/common/imagelib/img_ktx2.c

@ -87,6 +87,12 @@ static qboolean Image_KTX2Parse( const ktx2_header_t *header, const byte *buffer
return false; return false;
} }
if( header->levelCount == 0 )
{
Con_DPrintf( S_ERROR "%s: file has no mip levels\n", __FUNCTION__ );
return false;
}
if( header->pixelDepth > 1 ) if( header->pixelDepth > 1 )
{ {
Con_DPrintf( S_ERROR "%s: unsupported KTX2 pixelDepth %d\n", __FUNCTION__, header->pixelDepth ); Con_DPrintf( S_ERROR "%s: unsupported KTX2 pixelDepth %d\n", __FUNCTION__, header->pixelDepth );

Loading…
Cancel
Save