From 3e27d5028c8228e28ef0d0332ed1c390b7209276 Mon Sep 17 00:00:00 2001 From: Aotumuri Date: Sun, 1 Jun 2025 19:48:16 +0900 Subject: [PATCH] fixed --- src/client/Cosmetic.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/Cosmetic.ts b/src/client/Cosmetic.ts index fdbc3fefc..b560394b1 100644 --- a/src/client/Cosmetic.ts +++ b/src/client/Cosmetic.ts @@ -26,6 +26,12 @@ export class PatternDecoder { constructor(base64: string) { const bytes = base64url.decode(base64); + if (bytes.length < 7) { + throw new Error( + "Pattern data is too short to contain required metadata.", + ); + } + const version = bytes[0]; if (version !== 1) { throw new Error("The pattern versions are different.");