File: fix-divbyzero.diff

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 218,192 kB
  • sloc: cpp: 291,369; xml: 200,226; sh: 3,779; ansic: 1,447; python: 393; makefile: 249; perl: 82; pascal: 79
file content (16 lines) | stat: -rw-r--r-- 601 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Forwarded: part of Origin PR by Jojo-Schmitz
Origin: https://github.com/musescore/MuseScore/pull/9000
Author: Joachim Schmitz <jojo@schmitz-digital.de>
Description: part of a bugfix that’s generally useful

--- a/libmscore/fraction.h
+++ b/libmscore/fraction.h
@@ -227,7 +227,7 @@ class Fraction {
 
       int ticks() const
             {
-            if (_numerator == -1 && _denominator == 1)        // HACK
+            if ((_numerator == -1 && _denominator == 1) || _denominator == 0)        // HACK
                   return -1;
 
             // MScore::division     - ticks per quarter note