Commit b03c8a71 by J. Oliva

Mime type string always finish with a single 0 byte

Mime type string always finish with a single 0 byte
parent 88475e4f
...@@ -91,7 +91,7 @@ public class Id3Parser implements MetadataParser<Map<String, Object>> { ...@@ -91,7 +91,7 @@ public class Id3Parser implements MetadataParser<Map<String, Object>> {
int firstZeroIndex = indexOf(frame, 0, (byte) 0); int firstZeroIndex = indexOf(frame, 0, (byte) 0);
String mimeType = new String(frame, 0, firstZeroIndex, "ISO-8859-1"); String mimeType = new String(frame, 0, firstZeroIndex, "ISO-8859-1");
int filenameStartIndex = firstZeroIndex + delimiterLength(encoding); int filenameStartIndex = firstZeroIndex + 1;
int filenameEndIndex = indexOfEOS(frame, filenameStartIndex, encoding); int filenameEndIndex = indexOfEOS(frame, filenameStartIndex, encoding);
String filename = new String(frame, filenameStartIndex, String filename = new String(frame, filenameStartIndex,
filenameEndIndex - filenameStartIndex, charset); filenameEndIndex - filenameStartIndex, charset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment