diff --git a/Cargo.toml b/Cargo.toml index 5077e2ac..1c5fe097 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ flate2 = { version = "1.0.22", optional = true } # Vorbis comments pictures base64 = { version = "0.13.0", optional = true } # OGG Vorbis/Opus -ogg_pager = "0.2.0" +ogg_pager = "0.3.0" # Key maps lazy_static = "1.4.0" paste = "1.0.6" diff --git a/src/ogg/opus/write.rs b/src/ogg/opus/write.rs index 7086c553..e1a72d62 100644 --- a/src/ogg/opus/write.rs +++ b/src/ogg/opus/write.rs @@ -32,9 +32,9 @@ pub(crate) fn write_to( for mut p in pages.iter_mut() { p.serial = ser; - p.gen_crc(); + p.gen_crc()?; - writer.write_all(&*p.as_bytes())?; + writer.write_all(&*p.as_bytes()?)?; } writer.write_all(&*remaining)?; diff --git a/src/ogg/vorbis/write.rs b/src/ogg/vorbis/write.rs index 1dae63ca..7a4caedc 100644 --- a/src/ogg/vorbis/write.rs +++ b/src/ogg/vorbis/write.rs @@ -82,7 +82,7 @@ pub(crate) fn write_to( if i == pages_len { // Add back the framing bit - p.extend(&[1]); + p.extend(&[1])?; // The segment tables of current page and the setup header have to be combined let mut seg_table = Vec::new(); @@ -98,9 +98,9 @@ pub(crate) fn write_to( seg_table.insert(0, seg_table_len as u8); - let page = p.extend(&*setup); + let page = p.extend(&*setup)?; - let mut p_bytes = p.as_bytes(); + let mut p_bytes = p.as_bytes()?; let seg_count = p_bytes[26] as usize; // Replace segment table and checksum @@ -111,16 +111,16 @@ pub(crate) fn write_to( if let Some(mut page) = page { page.serial = ser; - page.gen_crc(); + page.gen_crc()?; - writer.write_all(&*page.as_bytes())?; + writer.write_all(&*page.as_bytes()?)?; } break; } - p.gen_crc(); - writer.write_all(&*p.as_bytes())?; + p.gen_crc()?; + writer.write_all(&*p.as_bytes()?)?; } writer.write_all(&*remaining)?; diff --git a/src/ogg/write.rs b/src/ogg/write.rs index bb3649b6..7bf7f112 100644 --- a/src/ogg/write.rs +++ b/src/ogg/write.rs @@ -91,7 +91,7 @@ pub(super) fn write(data: &mut File, tag: &mut VorbisCommentsRef, sig: &[u8]) -> let ser = first_page.serial; let mut writer = Vec::new(); - writer.write_all(&*first_page.as_bytes())?; + writer.write_all(&*first_page.as_bytes()?)?; let first_md_page = Page::read(data, false)?; verify_signature(&first_md_page, sig)?;