VideoCommon: when loading a PNG with no custom texture data levels already, create a level, this avoids a potential segfault

This commit is contained in:
iwubcode
2023-06-02 22:02:37 -05:00
parent d03e09c8fd
commit 47c40d51df
3 changed files with 5 additions and 8 deletions

View File

@ -515,11 +515,6 @@ bool LoadDDSTexture(CustomTextureData::Level* level, const std::string& filename
info.first_mip_row_length, info.first_mip_size);
}
bool LoadPNGTexture(CustomTextureData* texture, const std::string& filename)
{
return LoadPNGTexture(&texture->m_levels[0], filename);
}
bool LoadPNGTexture(CustomTextureData::Level* level, const std::string& filename)
{
if (!level) [[unlikely]]