From c54e75a899e7cfcac10a4521472d8baabd8e1f82 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 27 May 2024 23:46:04 +0100 Subject: [PATCH] Show error for invalid LAYER/CODEC versions --- src/Mp3Info.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mp3Info.php b/src/Mp3Info.php index 57d27d7..791dab3 100644 --- a/src/Mp3Info.php +++ b/src/Mp3Info.php @@ -372,12 +372,13 @@ class Mp3Info switch (ord($headerBytes[1]) >> 3 & 0b11) { case 0b00: $this->codecVersion = self::MPEG_25; break; - case 0b01: return null; break; + case 0b01: echo 'INVALID CODEC VERSION'; return null; break; case 0b10: $this->codecVersion = self::MPEG_2; break; case 0b11: $this->codecVersion = self::MPEG_1; break; } switch (ord($headerBytes[1]) >> 1 & 0b11) { + case 0b00: echo 'INVALID LAYER VERSION'; return null; break; case 0b01: $this->layerVersion = self::LAYER_3; break; case 0b10: $this->layerVersion = self::LAYER_2; break; case 0b11: $this->layerVersion = self::LAYER_1; break;