From 5b8e15a1e03c9f4716956ee1253c59fd3dc5919a Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 27 May 2024 23:44:22 +0100 Subject: [PATCH] Fix Mpeg frame sync detection --- src/Mp3Info.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mp3Info.php b/src/Mp3Info.php index 44ad8fc..09798d2 100644 --- a/src/Mp3Info.php +++ b/src/Mp3Info.php @@ -360,7 +360,7 @@ class Mp3Info $headerBytes .= $this->fileObj->getBytes(1); // load next Byte $headerBytes = substr($headerBytes, -4); // limit to 4 Bytes - if (unpack('n', $headerBytes)[1] & self::FRAME_SYNC === self::FRAME_SYNC) { + if ((unpack('n', $headerBytes)[1] & self::FRAME_SYNC) === self::FRAME_SYNC) { $pos = $this->fileObj->getFilePos() - 4; break; } @@ -1070,7 +1070,7 @@ class Mp3Info // id3v2 tag return true; } - if (unpack('n', $raw)[1] & self::FRAME_SYNC === self::FRAME_SYNC) { + if ((unpack('n', $raw)[1] & self::FRAME_SYNC) === self::FRAME_SYNC) { // mpeg header tag return true; }