diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 305267da1..d111e77a1 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -2666,7 +2666,9 @@ RenderDrawLinesWithRects(SDL_Renderer * renderer, } } - retval += QueueCmdFillRects(renderer, frects, nrects); + if (nrects) { + retval += QueueCmdFillRects(renderer, frects, nrects); + } SDL_small_free(frects, isstack); @@ -2721,7 +2723,9 @@ RenderDrawLinesWithRectsF(SDL_Renderer * renderer, } } - retval += QueueCmdFillRects(renderer, frects, nrects); + if (nrects) { + retval += QueueCmdFillRects(renderer, frects, nrects); + } SDL_small_free(frects, isstack);