mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
SDL_BlitSurfaceScaled(): Do not divide by zero
(cherry picked from commit fe849f1572
)
This commit is contained in:

committed by
Sam Lantinga

parent
6d8309f72e
commit
c1779ca4a5
@@ -1133,6 +1133,13 @@ bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surfac
|
||||
return SDL_BlitSurface(src, srcrect, dst, dstrect);
|
||||
}
|
||||
|
||||
if (src_w == 0) {
|
||||
src_w = 1;
|
||||
}
|
||||
if (src_h == 0) {
|
||||
src_h = 1;
|
||||
}
|
||||
|
||||
scaling_w = (double)dst_w / src_w;
|
||||
scaling_h = (double)dst_h / src_h;
|
||||
|
||||
|
Reference in New Issue
Block a user