Skip to content

Commit 4767f5d

Browse files
committed
ID3v2: Don't expect text frames to be terminated
1 parent d4916c4 commit 4767f5d

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3939
incorrect duration and bitrate values.
4040
- **APE**: Reading properties on older files will no longer error
4141
- Older APE stream versions were not properly handled, leading to incorrect properties and errors.
42+
- **ID3v2**: Don't expect text frames to be null terminated
4243

4344
## [0.15.0] - 2023-07-11
4445

src/id3/v2/items/text_information_frame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl TextInformationFrame {
3737
};
3838

3939
let encoding = verify_encoding(encoding_byte, version)?;
40-
let value = decode_text(reader, encoding, true)?.content;
40+
let value = decode_text(reader, encoding, false)?.content;
4141

4242
Ok(Some(TextInformationFrame { encoding, value }))
4343
}

src/id3/v2/tag.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,4 +2364,11 @@ mod tests {
23642364
assert!(id3v2.remove_user_text(&description2).is_some());
23652365
assert!(id3v2.is_empty());
23662366
}
2367+
2368+
#[test]
2369+
fn read_multiple_composers_should_not_fail_with_bad_frame_length() {
2370+
// Issue #255
2371+
let tag = read_tag("tests/tags/assets/id3v2/multiple_composers.id3v24");
2372+
assert_eq!(tag.get_text("TCOM").as_deref().unwrap(), "A/B");
2373+
}
23672374
}
1.43 KB
Binary file not shown.

0 commit comments

Comments
 (0)