match iimg.format.fourcc().map_err(|_| DecoderError::InvalidData)? {
VAFourcc::NV12 => {
let frm = NASimpleVideoFrame::from_video_buf(&mut vbuf).unwrap();
- validate!(iimg.width == (frm.width[0] as u16));
- validate!(iimg.height == (frm.height[0] as u16));
+ validate!(iimg.width == (((frm.width[0] + 15) & !15) as u16));
+ validate!(iimg.height == (((frm.height[0] + 15) & !15) as u16));
copy_luma(&mut frm.data[frm.offset[0]..], frm.stride[0], &imgdata[iimg.offsets[0] as usize..], iimg.pitches[0] as usize, frm.width[0], frm.height[0]);
self.vaapi = Some(VaapiInternals { display, context, ref_pics, surfaces, ifmt });
- let vinfo = NAVideoInfo::new(width, height, false, YUV420_FORMAT);
+ let vinfo = NAVideoInfo::new(vinfo.get_width(), vinfo.get_height(), false, YUV420_FORMAT);
self.info = NACodecInfo::new_ref(info.get_name(), NACodecTypeInfo::Video(vinfo), info.get_extradata()).into_ref();
self.out_frm = alloc_video_buffer(vinfo, 4)?;