mirror of https://github.com/WerWolv/ImHex.git
fix: Texture interpreting raw data as structured images
This commit is contained in:
parent
cab329556c
commit
9530100455
|
@ -46,7 +46,11 @@ namespace ImGuiExt {
|
|||
if (size == 0)
|
||||
return;
|
||||
|
||||
unsigned char *imageData = stbi_load_from_memory(buffer, size, &m_width, &m_height, nullptr, 4);
|
||||
unsigned char *imageData = nullptr;
|
||||
|
||||
if (width == 0 || height == 0)
|
||||
imageData = stbi_load_from_memory(buffer, size, &m_width, &m_height, nullptr, 4);
|
||||
|
||||
if (imageData == nullptr) {
|
||||
if (width * height * 4 > size)
|
||||
return;
|
||||
|
|
|
@ -341,7 +341,7 @@ namespace hex::init {
|
|||
{ "Setting up environment", setupEnvironment, false },
|
||||
{ "Creating directories", createDirectories, false },
|
||||
{ "Loading settings", loadSettings, false },
|
||||
{ "Loading plugins", loadPlugins, false },
|
||||
{ "Loading plugins", loadPlugins, false },
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue