Skip to content

Commit

Permalink
ID3v2: Stop writing synchsafe integers for ID3v2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed Jul 15, 2024
1 parent 5a3a8ba commit 38002d1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lofty/src/id3/v2/write/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ where
fn write_frame_header<W>(
writer: &mut W,
name: &str,
len: u32,
mut len: u32,
flags: FrameFlags,
is_id3v23: bool,
) -> Result<()>
Expand All @@ -282,8 +282,12 @@ where
flags.as_id3v24_bytes()
};

if !is_id3v23 {
len = len.synch()?;
}

writer.write_all(name.as_bytes())?;
writer.write_u32::<BigEndian>(len.synch()?)?;
writer.write_u32::<BigEndian>(len)?;
writer.write_u16::<BigEndian>(flags)?;

Ok(())
Expand Down

0 comments on commit 38002d1

Please sign in to comment.