Skip to content

Commit 9768788

Browse files
committed
FLAC: Ignore ID3v2 tags in Vorbis Comment writer
1 parent 819d81e commit 9768788

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [0.23.2] - 2026-02-14
1010

11-
- **FLAC**: Fix duplicate `Last-metadata-block` flags in the presence of PADDING blocks ([issue](https://github.com/Serial-ATA/lofty-rs/issues/607)) ([PR](https://github.com/Serial-ATA/lofty-rs/pull/609))
11+
- **FLAC**:
12+
- Fix duplicate `Last-metadata-block` flags in the presence of PADDING blocks ([issue](https://github.com/Serial-ATA/lofty-rs/issues/607)) ([PR](https://github.com/Serial-ATA/lofty-rs/pull/609))
13+
- Ignore ID3v2 tags when not stripped during write ([issue](https://github.com/Serial-ATA/lofty-rs/issues/608)) ([PR](https://github.com/Serial-ATA/lofty-rs/pull/609))
14+
- Previously, the Vorbis Comments writer assumed that the ID3v2 tag had already been stripped.
15+
If that wasn't the case, it would error that it couldn't find the FLAC stream marker.
1216

1317
## [0.23.1] - 2026-02-08
1418

lofty/src/flac/write.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use super::block::{BLOCK_ID_PADDING, BLOCK_ID_PICTURE, BLOCK_ID_VORBIS_COMMENTS,
22
use super::read::verify_flac;
33
use crate::config::WriteOptions;
44
use crate::error::{LoftyError, Result};
5+
use crate::id3::{FindId3v2Config, find_id3v2};
56
use crate::macros::{err, try_vec};
67
use crate::ogg::tag::VorbisCommentsRef;
78
use crate::picture::{Picture, PictureInformation};
@@ -76,6 +77,9 @@ where
7677

7778
let mut cursor = Cursor::new(file_bytes);
7879

80+
// We don't actually need the ID3v2 tag, but reading it will seek to the end of it if it exists
81+
find_id3v2(&mut cursor, FindId3v2Config::NO_READ_TAG)?;
82+
7983
let stream_info = verify_flac(&mut cursor)?;
8084
let stream_info_start = stream_info.start as usize;
8185
let stream_info_end = stream_info.end as usize;

0 commit comments

Comments
 (0)