Skip to content

Commit

Permalink
UMusic: Consider line duration 0 as no duration
Browse files Browse the repository at this point in the history
All users of HasLength use the return line duration as divisor.
To avoid division by zero, set the result to false if the duration is 0.
  • Loading branch information
s09bQ5 committed Sep 11, 2024
1 parent 12448ee commit ed67553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/base/UMusic.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,8 @@ function TLine.HasLength(out Len: integer): boolean;
Result := false;
if Length(Notes) >= 0 then
begin
Result := true;
Len := EndBeat - Notes[0].StartBeat;
Result := (Len > 0);
end;
end;

Expand Down

0 comments on commit ed67553

Please sign in to comment.