diff --git a/Cargo.lock b/Cargo.lock index c9ab906ff..5011f7092 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1731,7 +1731,7 @@ dependencies = [ [[package]] name = "h263-rs" version = "0.1.0" -source = "git+https://github.com/ruffle-rs/h263-rs?rev=f0083f5933f173798dd308d1678f06d181a99975#f0083f5933f173798dd308d1678f06d181a99975" +source = "git+https://github.com/ruffle-rs/h263-rs?rev=78d96c0034c519482c8f81e1042c86fc3684f7b3#78d96c0034c519482c8f81e1042c86fc3684f7b3" dependencies = [ "bitflags", "lazy_static", @@ -1742,7 +1742,7 @@ dependencies = [ [[package]] name = "h263-rs-yuv" version = "0.1.0" -source = "git+https://github.com/ruffle-rs/h263-rs?rev=f0083f5933f173798dd308d1678f06d181a99975#f0083f5933f173798dd308d1678f06d181a99975" +source = "git+https://github.com/ruffle-rs/h263-rs?rev=78d96c0034c519482c8f81e1042c86fc3684f7b3#78d96c0034c519482c8f81e1042c86fc3684f7b3" dependencies = [ "bytemuck", "wide", @@ -4709,9 +4709,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feff0a412894d67223777b6cc8d68c0dab06d52d95e9890d5f2d47f10dd9366c" +checksum = "b689b6c49d6549434bf944e6b0f39238cf63693cb7a147e9d887507fffa3b223" dependencies = [ "bytemuck", "safe_arch", diff --git a/video/software/Cargo.toml b/video/software/Cargo.toml index eed515c43..9e0893407 100644 --- a/video/software/Cargo.toml +++ b/video/software/Cargo.toml @@ -16,8 +16,8 @@ thiserror = "1.0" flate2 = "1.0.25" log = "0.4" -h263-rs = { git = "https://github.com/ruffle-rs/h263-rs", rev = "f0083f5933f173798dd308d1678f06d181a99975", optional = true } -h263-rs-yuv = { git = "https://github.com/ruffle-rs/h263-rs", rev = "f0083f5933f173798dd308d1678f06d181a99975", optional = true } +h263-rs = { git = "https://github.com/ruffle-rs/h263-rs", rev = "78d96c0034c519482c8f81e1042c86fc3684f7b3", optional = true } +h263-rs-yuv = { git = "https://github.com/ruffle-rs/h263-rs", rev = "78d96c0034c519482c8f81e1042c86fc3684f7b3", optional = true } nihav_core = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true } nihav_codec_support = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true } nihav_duck = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true } diff --git a/video/software/src/decoder/h263.rs b/video/software/src/decoder/h263.rs index 6ef49e0c9..938e2fa9e 100644 --- a/video/software/src/decoder/h263.rs +++ b/video/software/src/decoder/h263.rs @@ -69,8 +69,9 @@ impl VideoDecoder for H263Decoder { .into_width_and_height() .ok_or(H263Error::MissingWidthHeight)?; let chroma_width = picture.chroma_samples_per_row(); + debug_assert_eq!(chroma_width, (width as usize + 1) / 2); let (y, b, r) = picture.as_yuv(); - let rgba = yuv420_to_rgba(y, b, r, width.into(), chroma_width); + let rgba = yuv420_to_rgba(y, b, r, width.into()); Ok(DecodedFrame { width, height, diff --git a/video/software/src/decoder/vp6.rs b/video/software/src/decoder/vp6.rs index 97cf01ea5..a94358cb9 100644 --- a/video/software/src/decoder/vp6.rs +++ b/video/software/src/decoder/vp6.rs @@ -156,6 +156,8 @@ impl VideoDecoder for Vp6Decoder { let (mut width, mut height) = frame.get_dimensions(0); let (chroma_width, chroma_height) = frame.get_dimensions(1); + debug_assert_eq!(chroma_width, (width + 1) / 2); + debug_assert_eq!(chroma_height, (height + 1) / 2); // We assume that there is no padding between rows debug_assert!(frame.get_stride(0) == frame.get_dimensions(0).0); @@ -174,7 +176,6 @@ impl VideoDecoder for Vp6Decoder { &yuv[offsets.1..offsets.1 + chroma_width * chroma_height], &yuv[offsets.2..offsets.2 + chroma_width * chroma_height], width, - chroma_width, ); // Adding in the alpha component, if present.