nihav_itu: ignore high-profile extradata tail when it is not correct
[nihav.git] / nihav-itu / src / codecs / h264 / decoder_st.rs
index 94b3977c0622d3c046219fba2844f53b97e92f3e..fad0dd9ac539a9276b74fa65382e79e7a050fe27 100644 (file)
@@ -756,7 +756,10 @@ impl NADecoder for H264Decoder {
                     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);