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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
_SDL_turnOnPCSpeaker
The _SDL_turnOnPCSpeaker function performs this operation:
pcPhaseLength = (pcSample*AudioSpec.freq)/(2*PC_BASE_TIMER);
now, pcSample is a 16 bit unsigned, and AudioSpec.freq a 32 bit signed; their product yields a 32 bit signed.
pcSample
AudioSpec.freq
Since pcSample does reach a value of 65535, and AudioSpec.freq can be 48000, the result will overflow the 32 bit signed capacity.
I guess that one of the two should be casted to a 32 bit unsigned, which, conveniently, is also the pcPhaseLength size.
pcPhaseLength
Snippet here.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The
_SDL_turnOnPCSpeaker
function performs this operation:now,
pcSample
is a 16 bit unsigned, andAudioSpec.freq
a 32 bit signed; their product yields a 32 bit signed.Since
pcSample
does reach a value of 65535, andAudioSpec.freq
can be 48000, the result will overflow the 32 bit signed capacity.I guess that one of the two should be casted to a 32 bit unsigned, which, conveniently, is also the
pcPhaseLength
size.Snippet here.
The text was updated successfully, but these errors were encountered: