Fixed crash on 64-bit systems
authorSam Lantinga <slouken@libsdl.org>
Wed, 03 Dec 2008 06:32:04 +0000
changeset 2826 cd4a49d5c1ba
parent 2825 620a91b6d263
child 2827 aec4399c507a
Fixed crash on 64-bit systems
src/video/SDL_blit_copy.c
--- a/src/video/SDL_blit_copy.c	Wed Dec 03 04:32:24 2008 +0000
+++ b/src/video/SDL_blit_copy.c	Wed Dec 03 06:32:04 2008 +0000
@@ -106,7 +106,9 @@
     dstskip = info->dst_pitch;
 
 #ifdef __SSE__
-    if (SDL_HasSSE() && !((uintptr_t) src & 15) && !((uintptr_t) dst & 15)) {
+    if (SDL_HasSSE() &&
+        !((uintptr_t) src & 15) && !(srcskip & 15) &&
+        !((uintptr_t) dst & 15) && !(dstskip & 15)) {
         while (h--) {
             SDL_memcpySSE(dst, src, w);
             src += srcskip;
@@ -117,7 +119,9 @@
 #endif
 
 #ifdef __MMX__
-    if (SDL_HasMMX() && !((uintptr_t) src & 7) && !((uintptr_t) dst & 7)) {
+    if (SDL_HasMMX() &&
+        !((uintptr_t) src & 7) && !(srcskip & 7) &&
+        !((uintptr_t) dst & 7) && !(dstskip & 7)) {
         while (h--) {
             SDL_memcpyMMX(dst, src, w);
             src += srcskip;