From af5d7e1b61df8cc7fc153e3d3cc5e29aa147fb74 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Sat, 14 Feb 2026 02:04:16 -0500 Subject: [PATCH 1/2] FLAC: Fix duplicate `Last-metadata-block` flags --- CHANGELOG.md | 4 ++++ lofty/src/flac/write.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a11209d61..5944da3d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.23.2] - 2026-02-14 + +- **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)) + ## [0.23.1] - 2026-02-08 ### Fixed diff --git a/lofty/src/flac/write.rs b/lofty/src/flac/write.rs index 75bb366d6..e65c4f4c5 100644 --- a/lofty/src/flac/write.rs +++ b/lofty/src/flac/write.rs @@ -135,6 +135,7 @@ where // `PADDING` always goes last last_block_replaced = true; + last_block_location = LastBlock::Padding; let mut padding_block = Block::new_padding(preferred_padding as usize)?; padding_block.last = true; From 57d5dd98b5b2dc75e29c79f748a3131a5b0c6d94 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Sat, 14 Feb 2026 02:22:13 -0500 Subject: [PATCH 2/2] FLAC: Ignore ID3v2 tags in Vorbis Comment writer --- CHANGELOG.md | 6 +++++- lofty/src/flac/write.rs | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5944da3d3..8408701a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.23.2] - 2026-02-14 -- **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)) +- **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)) + - 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)) + - Previously, the Vorbis Comments writer assumed that the ID3v2 tag had already been stripped. + If that wasn't the case, it would error that it couldn't find the FLAC stream marker. ## [0.23.1] - 2026-02-08 diff --git a/lofty/src/flac/write.rs b/lofty/src/flac/write.rs index e65c4f4c5..6c4a4e358 100644 --- a/lofty/src/flac/write.rs +++ b/lofty/src/flac/write.rs @@ -2,6 +2,7 @@ use super::block::{BLOCK_ID_PADDING, BLOCK_ID_PICTURE, BLOCK_ID_VORBIS_COMMENTS, use super::read::verify_flac; use crate::config::WriteOptions; use crate::error::{LoftyError, Result}; +use crate::id3::{FindId3v2Config, find_id3v2}; use crate::macros::{err, try_vec}; use crate::ogg::tag::VorbisCommentsRef; use crate::picture::{Picture, PictureInformation}; @@ -76,6 +77,9 @@ where let mut cursor = Cursor::new(file_bytes); + // We don't actually need the ID3v2 tag, but reading it will seek to the end of it if it exists + find_id3v2(&mut cursor, FindId3v2Config::NO_READ_TAG)?; + let stream_info = verify_flac(&mut cursor)?; let stream_info_start = stream_info.start as usize; let stream_info_end = stream_info.end as usize;