libretro / hatari

New rebasing of Hatari based on Mercurial upstream. Tries to be a shallow fork for easy upstreaming later on.
25 stars 41 forks source link

sound.c type mismatch, possible out of bound read? #56

Closed bbbradsmith closed 3 years ago

bbbradsmith commented 3 years ago

This code seems to be copy pasted from audio.c Audio_Callback and modified. "SNDBUF" is not a Uint8* like the original "stream" so the remaining samples logic here was off by a factor of 2.

The second commit restores the original whitespace to the copied code to make it more readable.

bbbradsmith commented 3 years ago

Taking a look at the current Hatari, it looks like they got rid of that "reuse previous samples" approach and just fill with zero now:

https://github.com/hatari/hatari/blob/50c7632c9482f2e68a4107f13dc5d56a54f2a756/src/audio.c#L77

inactive123 commented 3 years ago

Ah, glad we are getting a PR from someone with some interest in this core. If you have any other good additions to the core don't hesitate to send more PRs for us, this core definitely needs more love.