Merge pull request #11 from otnavle/master

Add empty checking for readbytes and headerBytes
This commit is contained in:
Sergey 2018-10-04 21:09:03 +03:00 committed by GitHub
commit 0d5a492d28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,6 +316,7 @@ class Mp3Info {
private function readBytes($fp, $n) {
$raw = fread($fp, $n);
if (strlen($raw) !== $n) throw new \Exception('Unexpected end of file!');
$bytes = array();
for($i = 0; $i < $n; $i++) $bytes[$i] = ord($raw[$i]);
return $bytes;