Don't divide by zero in slow blitter
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled

Other blitters seem to handle zero width/height destinations correctly.

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
(cherry picked from commit 53ee410d7a)
This commit is contained in:
Marcin Serwin
2025-11-09 07:26:37 -08:00
committed by Sam Lantinga
parent 5d0919855e
commit 45b0460019
+2 -2
View File
@@ -85,8 +85,8 @@ void SDL_Blit_Slow(SDL_BlitInfo *info)
last_index = SDL_LookupRGBAColor(palette_map, last_pixel, dst_pal);
}
incy = ((Uint64)info->src_h << 16) / info->dst_h;
incx = ((Uint64)info->src_w << 16) / info->dst_w;
incy = info->dst_h ? ((Uint64)info->src_h << 16) / info->dst_h : 0;
incx = info->dst_w ? ((Uint64)info->src_w << 16) / info->dst_w : 0;
posy = incy / 2; // start at the middle of pixel
while (info->dst_h--) {