From c75f4e0a393fbc05a8e86520f85c82d5fb925c61 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sun, 28 May 2023 16:33:05 +0200 Subject: [PATCH] fix: add string as return for getCover and make sure to not pass false to fseek Signed-off-by: Daniel Kesselberg --- src/Mp3Info.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mp3Info.php b/src/Mp3Info.php index b67ae7a..ad6bca3 100644 --- a/src/Mp3Info.php +++ b/src/Mp3Info.php @@ -233,7 +233,7 @@ public function __construct($filename, $parseTags = false) { /** - * @return bool|null + * @return bool|null|string */ public function getCover() { @@ -242,6 +242,9 @@ public function getCover() } $fp = fopen($this->_fileName, 'rb'); + if ($fp === false) { + return false; + } fseek($fp, $this->coverProperties['offset']); $data = fread($fp, $this->coverProperties['size']); fclose($fp);