SDL_memcpyMMX(): Fixed handling of overflow bytes.
Thanks to Mason Wheeler for the fix!
This commit is contained in:
parent
e66bcd9efe
commit
cd6cd13137
1 changed files with 6 additions and 2 deletions
|
@ -59,6 +59,7 @@ SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len)
|
|||
static __inline__ void
|
||||
SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len)
|
||||
{
|
||||
const int remain = (len & 63);
|
||||
int i;
|
||||
|
||||
__m64* d64 = (__m64*)dst;
|
||||
|
@ -78,8 +79,11 @@ SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len)
|
|||
s64 += 8;
|
||||
}
|
||||
|
||||
if (len & 63)
|
||||
SDL_memcpy(dst, src, len & 63);
|
||||
if (remain)
|
||||
{
|
||||
const int skip = len - remain;
|
||||
SDL_memcpy(dst + skip, src + skip, remain);
|
||||
}
|
||||
}
|
||||
#endif /* __MMX__ */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue