| Summary: | bad memcpy in SDL_OpenAudio/open_audio_device/prepare_audiospec chain | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Rainer Deyke <rainerd> |
| Component: | audio | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | Fix to 'SDL_OpenAudio', as described in bug description. | ||
Fixed, thanks! https://hg.libsdl.org/SDL/rev/c9be8299ba6b |
Created attachment 1599 [details] Fix to 'SDL_OpenAudio', as described in bug description. If 'SDL_OpenAudio' is called with 'obtained == NULL', 'prepare_audiospec' performs a bad 'memcpy' with the destination and source pointing to the same block of memory. The problem appears to be on in 'SDL_OpenAudio', which calls open_audio_device with 'obtained = desired' when 'obtained == NULL'. 'open_audio_device' cannot deal with 'desired' and 'obtained' pointing to the same block of memory but can deal with 'obtained == NULL', so my proposed fix is to simply remove the special handling of 'obtained == NULL' from 'SDL_OpenAudio'.