HF RL Explorer

When saving an indexed surface (e.g., a surface created with SDL CreateSurface using SDL PIXELFORMAT INDEX8…

When saving an indexed surface (e.g., a surface created with SDL CreateSurface using SDL PIXELFORMAT INDEX8…: a task in LegoFlow-SWE (Harbor dataset). Reproduction c SDL Surface surface = SDL CreateSurface(100, 100, SDL PIXELFORMAT INDEX8); if (!surface) { / handle error / } // No palette set –…

The task

**Reproduction** ```c SDL_Surface *surface = SDL_CreateSurface(100, 100, SDL_PIXELFORMAT_INDEX8); if (!surface) { /* handle error */ } // No palette set – surface->format->palette is NULL if (!IMG_Save(surface, "test.png")) { // Save failed, but file "test.png" already exists on disk (empty/corrupted) } ```

Part of Lego-X/LegoFlow-SWE.