From 0a83a1252b6689b6f51ddb2efab1149b0e347954 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 8 Jan 2025 14:12:59 +0100 Subject: [PATCH] fix icon generator (works now) --- src/icon_generator.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/icon_generator.cpp b/src/icon_generator.cpp index c10bead..5a1a11e 100644 --- a/src/icon_generator.cpp +++ b/src/icon_generator.cpp @@ -19,18 +19,17 @@ SDL_Surface* base(void) { ); if (img_data == nullptr) { // not readable - return {}; + return nullptr; } - auto* surf = SDL_CreateSurfaceFrom(desc.width, desc.height, SDL_PIXELFORMAT_RGBA32, img_data, 0); + auto* surf = SDL_CreateSurfaceFrom(desc.width, desc.height, SDL_PIXELFORMAT_RGBA32, img_data, 4*desc.width); if (surf == nullptr) { - return {}; // ?? + return nullptr; } auto* surf_dup = SDL_DuplicateSurface(surf); SDL_DestroySurface(surf); - free(img_data); return surf_dup;