From 4deebbaea5a9b19234746c59cc7728b561540331 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 31 Oct 2026 15:59:15 +0100 Subject: [PATCH] hwdec_vaapi: allow H.264 configuration data without 'avcC' prefix --- hwdec-vaapi/src/h264/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hwdec-vaapi/src/h264/mod.rs b/hwdec-vaapi/src/h264/mod.rs index 08e6ed6..3b1718b 100644 --- a/hwdec-vaapi/src/h264/mod.rs +++ b/hwdec-vaapi/src/h264/mod.rs @@ -241,10 +241,12 @@ impl HWDecoderCore for VaapiH264Decoder { //print!("edata:"); for &el in edata.iter() { print!(" {:02X}", el); } println!(); let profile; let mut nal_buf = Vec::with_capacity(1024); - if edata.len() > 11 && &edata[0..4] == b"avcC" { + if edata.len() > 7 { let mut br = MemoryReader::new_read(edata.as_slice()); + if &edata[0..4] == b"avcC" { br.read_skip(4)?; + } let version = br.read_byte()?; validate!(version == 1); profile = br.read_byte()?; -- 2.47.3