fix #39536 - Crash when opening MusicXML produced in PhotoScore

Fix crash by initializing divisions and checking for invalid values. Works as expected on OS X, please test on Linux and Windows and commit if OK. Let me know if any problem occurs.