-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getUint16 - Index out of range #6
Comments
It's not always the filename length; it appears there's a general bug in the monkeypatched DataView.getStringUtf16. I debugged into it and found it choking on some headers with strings of encoding type 1. One or more of my files has a TCON frame with a 'size' of 1 and the payload is just a single byte of value 1, which is interpreted as the encoding type. Once getStringUtf16 decides encoding === 1, its next order of business is to read the BOM from an offset that's past the end of the buffer. I added a guard against this specific case:
...but there should probably be some attention paid to this type of error in the actual string-reading loop as well (you can't trust that the frame length is actually big enough to read everything you expect from it). Here's the example buffer: |
+1 thanks for this. fixed what I was seeing too. |
So how do I fix this problem? |
@Captainlonate, adding that guard @ntuckerxx is talking about seems to fix the problem (or at least avoid it). In if(bom) {
if(offset + 1 > this.byteLength) {
return "";
}
var bomInt = this.getUint16(offset);
if(bomInt === 0xFFFE) {
littleEndian = true;
}
offset += 2;
length -= 2;
} |
This has been added in #27. It doesn't seem like the best way we could do it but at least it fixes the issue. |
I'm still getting this with the patched branch and without having ridiculously long filenames. Not sure how to debug? Although mine is that
|
Ok so how in the world do i fix it cause i am just a user and when i'm trying to launch a agar.io server and try to join it i don' t see anything, i get this error RangeError: Offset is outside the bounds of the DataView What do i do? |
I am not sure why, but I am getting the error again with a couple files.
The tags of one of the files that produces the error are:
The file plays fine, both in my default media player, and if I point an |
Processing files having a long name, the following error appears:
By example, this error occurs while reading tags for file in:
/home/pi/music/dd/Aphrodites Child/1968 - End of the World/01 - End Of The World.mp3
Renaming the file of the folder with a shorter name solves the issue.
Regards,
kvalium
The text was updated successfully, but these errors were encountered: