We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reported in version: HG 2.0 Reported for operating system, platform: Other, Other
On 2009-05-28 15:57:32 +0000, Jehan wrote:
When below SDL_memset4() is called with len = 0. SW is freezing on Iphone platform. #define SDL_memset4(dst, val, len) do { unsigned _count = (len); unsigned _n = (_count + 3) / 4; Uint32 *_p = SDL_static_cast(Uint32 *, dst); Uint32 _val = (val); switch (_count % 4) { case 0: do { *_p++ = _val; case 3: *_p++ = _val; case 2: *_p++ = _val; case 1: *_p++ = _val; } while ( --_n ); } } while(0) Indeed if we enter the loop when n=0. We will be locked into an infinite loop due to pre-increment (--n). I assume that this function should just return if len == 0, Do you agree? I suggest a break when entering the do{}whiile(0) : if(!len) break;
When below SDL_memset4() is called with len = 0. SW is freezing on Iphone platform.
#define SDL_memset4(dst, val, len) do { unsigned _count = (len); unsigned _n = (_count + 3) / 4; Uint32 *_p = SDL_static_cast(Uint32 *, dst); Uint32 _val = (val); switch (_count % 4) { case 0: do { *_p++ = _val; case 3: *_p++ = _val; case 2: *_p++ = _val; case 1: *_p++ = _val; } while ( --_n ); } } while(0)
Indeed if we enter the loop when n=0. We will be locked into an infinite loop due to pre-increment (--n).
I assume that this function should just return if len == 0, Do you agree?
I suggest a break when entering the do{}whiile(0) : if(!len) break;
On 2009-06-25 10:58:05 +0000, Ozkan Sezer wrote:
Is SDL-1.2 not affected?
On 2009-08-07 03:20:56 +0000, Sam Lantinga wrote:
Yep, this affected SDL 1.2 as well. This is now fixed for both versions. Thanks!
Yep, this affected SDL 1.2 as well. This is now fixed for both versions.
Thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This bug report was migrated from our old Bugzilla tracker.
Reported in version: HG 2.0
Reported for operating system, platform: Other, Other
Comments on the original bug report:
On 2009-05-28 15:57:32 +0000, Jehan wrote:
On 2009-06-25 10:58:05 +0000, Ozkan Sezer wrote:
On 2009-08-07 03:20:56 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: