Skip to content
New issue

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

array overflows in SDL_audiotypecvt.c #240

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

array overflows in SDL_audiotypecvt.c #240

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.0
Reported for operating system, platform: Linux, Other

Comments on the original bug report:

On 2009-12-18 09:10:40 +0000, Terry Welsh wrote:

All of the oversampling and undersampling functions in SDL_audiotypecvt.c contain the line:

while (dst != target) {

Some or all of these functions are prone to array overflows because sometimes dst will be increased or decreased by an amount that skips over target. Changing != to < or > depending on whether dst is being increased or decreased corrects the problem.

One way to aggravate this problem is to call Mix_OpenAudio with a frequency of 44.1kHz and then try to load a 48000kHz sound.

This solution might leave some bytes at the end of arrays that have not been written to. If this is a problem, perhaps more careful sizing of the arrays is necessary.

On 2009-12-24 11:20:53 +0000, Sam Lantinga wrote:

Ryan is currently working on this. Ryan, what's your progress so far?

On 2009-12-28 00:31:08 +0000, Ryan C. Gordon wrote:

Fixed in svn revision # 5438. I'm not entirely pleased with the current resampling code, but this fixes the immediate problem.

--ryan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant