A zero source rect is valid for blitting
A zero sized source rect draws pixels sourced from a 0x0 region on the source surface. Fixes https://github.com/libsdl-org/SDL/issues/8580
This commit is contained in:
@@ -59,7 +59,7 @@ static bool SDLCALL SDL_SoftBlit(SDL_Surface *src, const SDL_Rect *srcrect,
|
||||
}
|
||||
|
||||
// Set up source and destination buffer pointers, and BLIT!
|
||||
if (okay && !SDL_RectEmpty(srcrect)) {
|
||||
if (okay) {
|
||||
SDL_BlitFunc RunBlit;
|
||||
SDL_BlitInfo *info = &src->internal->map.info;
|
||||
|
||||
|
||||
@@ -1226,7 +1226,7 @@ bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surfac
|
||||
SDL_GetRectIntersection(clip_rect, &final_dst, &final_dst);
|
||||
|
||||
if (final_dst.w == 0 || final_dst.h == 0 ||
|
||||
final_src.w <= 0 || final_src.h <= 0) {
|
||||
final_src.w < 0 || final_src.h < 0) {
|
||||
// No-op.
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user