From 19b09aa9cb92806fa727686be59c1fd2b0a1c629 Mon Sep 17 00:00:00 2001 From: Daniel Gruss Date: Thu, 25 Jul 2024 02:28:49 +0200 Subject: [PATCH] fix uninitialized variable without instrumentals tagfix uninitialized variable without instrumentals tag --- src/base/USong.pas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/base/USong.pas b/src/base/USong.pas index e88ed2620..796ddce38 100644 --- a/src/base/USong.pas +++ b/src/base/USong.pas @@ -878,9 +878,10 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean) if (Self.Path.Append(EncFile).IsFile) then begin self.Mp3 := EncFile; - if self.Karaoke = PATH_NONE() then + if (not Assigned(self.Karaoke)) or (self.Karaoke = PATH_NONE()) then + begin self.Karaoke := EncFile; - + end; //Add Mp3 Flag to Done Done := Done or 4; end @@ -940,11 +941,11 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean) end // Karaoke Mp3 - else if Identifier = 'INSTRUMENTAL' then + else if (Identifier = 'INSTRUMENTAL') then begin EncFile := DecodeFilename(Value); if (self.Path.Append(EncFile).IsFile) then - self.Karaoke := EncFile + self.Karaoke := EncFile; end // Video Gap