From 464ce95bf783cf05502eb7f1782a349ff245a3fa Mon Sep 17 00:00:00 2001 From: avolkov Date: Wed, 23 Nov 2005 00:05:25 +0000 Subject: [PATCH] Fix a crash bug in SSE nearest when scaling rects of width=1 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2015 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/nearest2x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sc2/src/sc2code/libs/graphics/sdl/nearest2x.c b/sc2/src/sc2code/libs/graphics/sdl/nearest2x.c index 0c8c5f697..37a0bde0e 100755 --- a/sc2/src/sc2code/libs/graphics/sdl/nearest2x.c +++ b/sc2/src/sc2code/libs/graphics/sdl/nearest2x.c @@ -94,6 +94,7 @@ SCALE_(Nearest) (SDL_Surface *src, SDL_Surface *dst, SDL_Rect *r) even_x: shr ecx, 1 // x = rw / 2 + jz end_x // rw was 1 loop_x: // two-pixel transfer @@ -111,7 +112,8 @@ SCALE_(Nearest) (SDL_Surface *src, SDL_Surface *dst, SDL_Rect *r) dec ecx jnz loop_x - + + end_x: // try to prefetch as early as possible to have it on time PREFETCH (esi + eax)