shithub: mcfs

Download patch

ref: f2ea43a808a7f23093b318e6400c67690f2c026b
parent: b1c20b110bb60ffba60baa27d7c076055438b8e2
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Mar 2 10:11:57 EST 2021

matroska: fix refblock handling

--- a/matroska.c
+++ b/matroska.c
@@ -243,11 +243,10 @@
 
 		if(off >= bgend && !skipdata){
 			if(npackets > 0){
-				if(te.fpacket(&out, &te, packets, npackets, ts, key || refblock) != 0)
+				if(te.fpacket(&out, &te, packets, npackets, ts, key || !refblock) != 0)
 					goto err;
 				npackets = 0;
 			}
-			refblock = 0;
 		}
 
 		n = ebmlel(f, left, &el, &sz);
@@ -311,7 +310,7 @@
 			continue;
 		}else if(el.id == EBlockGroup && !skipdata){
 			refblock = 0;
-			bgend = off+sz;
+			bgend = off+n+sz;
 			npackets = 0;
 			continue;
 		}else if((el.id == ESimpleBlock || el.id == EBlock) && !skipdata){