forge
Explore
Log in

Don't you dare go Hollow

B2: regression for PPS pic_init_qp_minus26 range check

Browse files at this commit

92a771d7f4b09006356bd2a72486b083ad048785Ahmet Kaan GümüşParent: fbcc820
Input RBSP [CE 01 A4] encodes pic_init_qp_minus26 = 26 (out of -62..=25) and
must be refused as Corrupt. Evidence: spec 7.4.2.2 range; the check was added
in fbcc820d.
crates/ec-h264-syntax/tests/fuzz_regressions.rsmodified+7 -0
@@ -28,3 +28,10 @@ fn annexb_repeated_empty_start_codes_do_not_recurse() {
28 let data = [0u8, 0, 1].repeat(1 << 18);28 let data = [0u8, 0, 1].repeat(1 << 18);
29 assert_eq!(AnnexBIter::new(&data).count(), 0);29 assert_eq!(AnnexBIter::new(&data).count(), 0);
30 }30 }
31+
32+#[test]
33+fn pps_pic_init_qp_out_of_range_is_corrupt() {
34+ let rbsp = [0xCEu8, 0x01, 0xA4];
35+ let err = Pps::parse(&rbsp, |_| None).expect_err("pic_init_qp_minus26 = 26 is corrupt");
36+ assert!(err.to_string().contains("pic_init_qp_minus26"), "wrong refusal: {err}");
37+}