mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
fix: Texture interpreting raw data as structured images
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user