Sometimes tag readers return invalid range in getTagIdentifierByteRange() which cause offset errors(jsmediatags attempts to read data with offset beyond file size). This PR doesn't fixes readers returning wrong ranges, but it adds some sanity checks to prevent unhandled exceptions like in #29.
To reproduce, you can generate small file:
echo hello > 1.wav
Without fix it will throw unhandled exception, with this fix onError will be called.
Sometimes tag readers return invalid range in
getTagIdentifierByteRange()
which cause offset errors(jsmediatags attempts to read data with offset beyond file size). This PR doesn't fixes readers returning wrong ranges, but it adds some sanity checks to prevent unhandled exceptions like in #29.To reproduce, you can generate small file:
Without fix it will throw unhandled exception, with this fix
onError
will be called.