Skip to content

Commit 38002d1

Browse files
committed
ID3v2: Stop writing synchsafe integers for ID3v2.3
1 parent 5a3a8ba commit 38002d1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lofty/src/id3/v2/write/frame.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ where
269269
fn write_frame_header<W>(
270270
writer: &mut W,
271271
name: &str,
272-
len: u32,
272+
mut len: u32,
273273
flags: FrameFlags,
274274
is_id3v23: bool,
275275
) -> Result<()>
@@ -282,8 +282,12 @@ where
282282
flags.as_id3v24_bytes()
283283
};
284284

285+
if !is_id3v23 {
286+
len = len.synch()?;
287+
}
288+
285289
writer.write_all(name.as_bytes())?;
286-
writer.write_u32::<BigEndian>(len.synch()?)?;
290+
writer.write_u32::<BigEndian>(len)?;
287291
writer.write_u16::<BigEndian>(flags)?;
288292

289293
Ok(())

0 commit comments

Comments
 (0)