Skip to content

Commit eac8ac3

Browse files
committed
Bug fixes
1 parent 353d28f commit eac8ac3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/id3/id3v1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
tags.track = buffer[offset + 29];
3636
} else {
3737
tags.comment = buffer.toString('ascii', offset, findZero(buffer, offset, offset + 30));
38-
tag.track = 0;
38+
tags.track = 0;
3939
}
4040

4141
tags.genre = GENRES[buffer[buffer.length - 1]];

lib/id3/id3v2_frames.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ exports.readData = function readData (b, type, offset, length, flags, major) {
7070
text;
7171
offset += 1;
7272

73-
if (b[start + length - 1] === 0) {
73+
if (b[start + length - 1] === 0 &&
74+
(start + length - 1) >= offset) {
7475
text = decodeString(b, charset, offset, start + length - 1).text;
7576
} else {
7677
text = decodeString(b, charset, offset, start + length).text;

0 commit comments

Comments
 (0)