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

Divide by zero crash in voc_get_block() #259

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

Divide by zero crash in voc_get_block() #259

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: unspecified
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2019-04-21 08:07:07 +0000, Mark Terbeck wrote:

The crash happens within the a extended information block (case VOC_EXTENDED) handling, due to the fact that number of channels is never set for mono samples. So when the sample rate is calculated the divisor is 0.

To fix this simply add a else clause - which sets the number of channels to 1 - to the if() which sets the number of channels to 2 for stereo.

This bug is present in SDL_mixer 1.2.12, SDL_mixer 2.0.4 and SDL_sound.

On 2019-04-21 12:19:24 +0000, Mark Terbeck wrote:

Created attachment 3761
VOC file that triggers the bug.

On 2020-06-26 21:52:29 +0000, Ozkan Sezer wrote:

Should be fixed in both SDL_mixer-1.2 and SDL2_mixer:
http://hg.libsdl.org/SDL_mixer/rev/33b9d022472d
http://hg.libsdl.org/SDL_mixer/rev/037c22bc945d

On 2020-06-26 22:01:07 +0000, Ozkan Sezer wrote:

SDL_sound version of fixes are in my fork of SDL_sound at github:
sezero/SDL_sound@a343b5a
sezero/SDL_sound@815ad21

(icculus doesn't seem to work on SDL_sound for quite some time..)

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