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:
TÖRÖK Attila 2023-04-19 00:38:42 +02:00 committed by Nathan Adams
parent 58821163b0
commit cbab1e54fe
1 changed files with 5 additions and 2 deletions

View File

@ -219,10 +219,13 @@ impl VideoDecoder for Vp6Decoder {
// Adding in the alpha component, if present.
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);
let alpha_offset = frame.get_offset(3);
let alpha = &yuv[alpha_offset..alpha_offset + width * height];
let a = crop(alpha, width, bounds);
let alpha = &yuv[alpha_offset..alpha_offset + alpha_width * alpha_height];
let a = crop(alpha, alpha_width, bounds);
let mut data = y.to_vec();
data.extend(u);