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

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;