dosbox-pure icon indicating copy to clipboard operation
dosbox-pure copied to clipboard

Fixed unexpected crashes caused by audio

Open sonercinar79 opened this issue 3 years ago • 1 comments

Since mixer.done and needed are declared as unsigned containers, they should be checked to avoid overflow. It was causing unexpected crashes.

sonercinar79 avatar May 17 '22 13:05 sonercinar79

Thanks you for opening this PR, before merging I need some more details about the issue.

Can you elaborate on what platform and with what kind of settings under Core Options -> Emulation Options you have a crash that is fixed with this?

As far as I understand the mixer code:

  • mixer.needed should always be equal or larger than mixer.done (see void MIXER_Mix(void))
  • mixer.done should always be equal or larger than reduce (see code above the submitted fix)

So it doesn't seem like it would help in any case unless you somehow are able to make these numbers wrap around which in itself would be a different problem (they are 64 bit numbers on 64 bit platforms so that seems highly unlikely).

schellingb avatar May 22 '22 17:05 schellingb

Closing this for now.

schellingb avatar Nov 30 '23 16:11 schellingb