Initialize the flood fill's dirty rectangle at its declaration
GCC cannot see that it is only read on a path where flood_region() wrote it, and warns under -Wmaybe-uninitialized. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -359,7 +359,9 @@ akerr_ErrorContext AKERR_NOIGNORE *akgl_draw_flood_fill(akgl_RenderBackend *self
|
||||
SDL_Surface *target = NULL;
|
||||
SDL_Surface *rgba = NULL;
|
||||
SDL_Texture *patch = NULL;
|
||||
SDL_Rect dirty;
|
||||
// Only written by a successful flood_region(), and only read after one, but
|
||||
// the paths in between are far enough apart that the compiler cannot see it.
|
||||
SDL_Rect dirty = { 0, 0, 0, 0 };
|
||||
SDL_FRect src;
|
||||
SDL_FRect dest;
|
||||
uint32_t *pixels = NULL;
|
||||
|
||||
Reference in New Issue
Block a user