video/vp6: Fix glitching with some VP6A videos (when Y and A frame sizes differ)
This regressed in 2ad4399
(#9753).
This commit is contained in:
parent
58821163b0
commit
cbab1e54fe
|
@ -219,10 +219,13 @@ impl VideoDecoder for Vp6Decoder {
|
||||||
|
|
||||||
// Adding in the alpha component, if present.
|
// Adding in the alpha component, if present.
|
||||||
if self.with_alpha {
|
if self.with_alpha {
|
||||||
|
// Apparently it's possible for the alpha channel to be coded in a different size than the Y channel.
|
||||||
|
let (alpha_width, alpha_height) = frame.get_dimensions(3);
|
||||||
debug_assert!(frame.get_stride(3) == frame.get_dimensions(3).0);
|
debug_assert!(frame.get_stride(3) == frame.get_dimensions(3).0);
|
||||||
|
|
||||||
let alpha_offset = frame.get_offset(3);
|
let alpha_offset = frame.get_offset(3);
|
||||||
let alpha = &yuv[alpha_offset..alpha_offset + width * height];
|
let alpha = &yuv[alpha_offset..alpha_offset + alpha_width * alpha_height];
|
||||||
let a = crop(alpha, width, bounds);
|
let a = crop(alpha, alpha_width, bounds);
|
||||||
|
|
||||||
let mut data = y.to_vec();
|
let mut data = y.to_vec();
|
||||||
data.extend(u);
|
data.extend(u);
|
||||||
|
|
Loading…
Reference in New Issue