wapmorgan / Mp3Info

The fastest PHP library to extract mp3 meta information (duration, bitrate, samplerate and so on) and tags (id3v1, id3v2).
https://wapmorgan.github.io/Mp3Info/
GNU Lesser General Public License v3.0
139 stars 41 forks source link

Add empty checking for readbytes and headerBytes #11

Closed ryanrigby17 closed 5 years ago

ryanrigby17 commented 6 years ago

This fixes an error I've experienced when trying to open files that aren't actually mp3 files but appear to be (modified magic number and mp3 extension).

The error I was previously getting was a near endless steam of Notice: Uninitialized string offset.

The fix means now an Exception is thrown and I can catch it and report that the file is invalid.