You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the method TimePos::quantize() is called with quantization 1/192, it causes an arithmetic exception because the variable interval ends up equal to 1 and the expression int snapUp = offset / (interval / 2); causes a division by 0.
Steps to reproduce
This bug was found out while code from a PR was being tested. It might not affect any existing functionality of LMMS, since I believe TimePos::quantize() is only being called when quantization is bigger than 1/192.
Expected behavior
TimePos::quantize() returning the same TimePos that it was given.
I was looking at the file from the branch I fetched from the PR, and just now I noticed it's 19 commits behind master. You're right, this is fixed by #5847 . Double facepalm because I was the one that submitted it 🤣
Bug Summary
If the method
TimePos::quantize()
is called with quantization 1/192, it causes an arithmetic exception because the variableinterval
ends up equal to 1 and the expressionint snapUp = offset / (interval / 2);
causes a division by 0.Steps to reproduce
This bug was found out while code from a PR was being tested. It might not affect any existing functionality of LMMS, since I believe
TimePos::quantize()
is only being called when quantization is bigger than 1/192.Expected behavior
TimePos::quantize()
returning the sameTimePos
that it was given.Actual behavior
Arithmetic Exception crash.
Thanks @rghvdberg for finding the bug!
The text was updated successfully, but these errors were encountered: