Revert S8 9d32686c: check_supported must run before the full slice header parse; SP/SI headers carry fields the parser does not read, so they surfaced as NeedMore instead of the named refusal
Browse files at this commite18142d2a629d664e03400a0a128b976e13c0159Parent: 57a2ea21 changed file +1 -1
crates/ec-h264/src/decoder.rsmodified+1 -1
| @@ -871,8 +871,8 @@ impl<S: Sample> Core<S> { | |||
| 871 | let sps = self.sps_map[pps.sps_id as usize] | 871 | let sps = self.sps_map[pps.sps_id as usize] |
| 872 | .clone() | 872 | .clone() |
| 873 | .ok_or_else(|| Error::corrupt("PPS refers to an unknown SPS"))?; | 873 | .ok_or_else(|| Error::corrupt("PPS refers to an unknown SPS"))?; |
| 874 | - let sh = SliceHeader::parse(rbsp, header, &sps, &pps)?; | ||
| 875 | check_supported::<S>(&sps, &pps, slice_type_code, self.wide)?; | 874 | check_supported::<S>(&sps, &pps, slice_type_code, self.wide)?; |
| 875 | + let sh = SliceHeader::parse(rbsp, header, &sps, &pps)?; | ||
| 876 | if self.has_picture && !self.cur.complete { | 876 | if self.has_picture && !self.cur.complete { |
| 877 | let same_picture = self.cur_key == Some(PicKey::of(&sh, header)); | 877 | let same_picture = self.cur_key == Some(PicKey::of(&sh, header)); |
| 878 | // A picture starts again at macroblock 0 once macroblock 0 is | 878 | // A picture starts again at macroblock 0 once macroblock 0 is |