]> git.nihav.org Git - nihav.git/blobdiff - nihav-duck/src/codecs/vp56.rs
vp3: fix fourmv block positions
[nihav.git] / nihav-duck / src / codecs / vp56.rs
index d0a991f32869c6d0175c6966dc0316bace200a58..03bd9fc9b052ec4c9730ca185a3855251d74e93c 100644 (file)
@@ -428,6 +428,9 @@ impl VP56Decoder {
         self.set_dimensions(vinfo.get_width(), vinfo.get_height());
         Ok(())
     }
+    pub fn flush(&mut self) {
+        self.shuf.clear();
+    }
     pub fn decode_frame(&mut self, supp: &mut NADecoderSupport, src: &[u8], br: &mut dyn VP56Parser) -> DecoderResult<(NABufferType, FrameType)> {
         let aoffset;
         let mut bc;
@@ -467,6 +470,10 @@ impl VP56Decoder {
 
         if hdr.is_intra {
             self.shuf.clear();
+        } else {
+            if !self.shuf.has_refs() {
+                return Err(DecoderError::MissingReference);
+            }
         }
 
         let mut cr;