From bf56f1530cd35b68bfca88c10e3170dabf5f6f02 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sun, 3 Mar 2024 15:00:19 +0100 Subject: [PATCH] hwdec_vaapi: ignore high-profile extradata tail when it is not correct --- hwdec-vaapi/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hwdec-vaapi/src/lib.rs b/hwdec-vaapi/src/lib.rs index 7b580d5..1ef3e41 100644 --- a/hwdec-vaapi/src/lib.rs +++ b/hwdec-vaapi/src/lib.rs @@ -484,7 +484,10 @@ impl VaapiH264Decoder { match profile { 100 | 110 | 122 | 144 => { let b = br.read_byte()?; - validate!((b & 0xFC) == 0xFC); + // some encoders put something different here + if (b & 0xFC) != 0xFC { + return Ok(()); + } // b & 3 -> chroma format let b = br.read_byte()?; validate!((b & 0xF8) == 0xF8); -- 2.30.2