mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 00:46:25 +00:00
Fixed potential wraparound issue with property IDs
This commit is contained in:
@@ -124,7 +124,11 @@ SDL_PropertiesID SDL_CreateProperties(void)
|
||||
}
|
||||
|
||||
if (SDL_LockRWLockForWriting(SDL_properties_lock) == 0) {
|
||||
props = ++SDL_last_properties_id;
|
||||
++SDL_last_properties_id;
|
||||
if (SDL_last_properties_id == 0) {
|
||||
++SDL_last_properties_id;
|
||||
}
|
||||
props = SDL_last_properties_id;
|
||||
if (SDL_InsertIntoHashTable(SDL_properties, (const void *)(uintptr_t)props, properties)) {
|
||||
inserted = SDL_TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user