From 38002d18b11e211835338c63b6c7af5272f1b434 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:14:17 -0400 Subject: [PATCH] ID3v2: Stop writing synchsafe integers for ID3v2.3 --- lofty/src/id3/v2/write/frame.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lofty/src/id3/v2/write/frame.rs b/lofty/src/id3/v2/write/frame.rs index ce846be3..2638a42e 100644 --- a/lofty/src/id3/v2/write/frame.rs +++ b/lofty/src/id3/v2/write/frame.rs @@ -269,7 +269,7 @@ where fn write_frame_header( writer: &mut W, name: &str, - len: u32, + mut len: u32, flags: FrameFlags, is_id3v23: bool, ) -> Result<()> @@ -282,8 +282,12 @@ where flags.as_id3v24_bytes() }; + if !is_id3v23 { + len = len.synch()?; + } + writer.write_all(name.as_bytes())?; - writer.write_u32::(len.synch()?)?; + writer.write_u32::(len)?; writer.write_u16::(flags)?; Ok(())