From 3af0c0239097b84412cc5e3ad12a64e8f692d0f8 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Sun, 18 Aug 2024 11:39:27 +0900 Subject: [PATCH] Reject unknown MODE in CUE --- shell/cdimage.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/shell/cdimage.ts b/shell/cdimage.ts index e9b5816..5647251 100644 --- a/shell/cdimage.ts +++ b/shell/cdimage.ts @@ -91,7 +91,16 @@ class ImgCueReader implements Reader { switch (fields[0]) { case 'TRACK': currentTrack = Number(fields[1]); - this.tracks[currentTrack] = { isAudio: fields[2] === 'AUDIO', index: [] }; + switch (fields[2]) { + case 'MODE1/2352': + this.tracks[currentTrack] = { isAudio: false, index: [] }; + break; + case 'AUDIO': + this.tracks[currentTrack] = { isAudio: true, index: [] }; + break; + default: + throw new Error(`${cueFile.name}: Unknown track mode "${fields[2]}"`); + } break; case 'INDEX': if (currentTrack)