shithub: mcfs

Download patch

ref: 610d6911a250a03d4a234a78f99c1d3772dd68a6
parent: def4aa492686c2babedc50d0f65e06b1eff14b21
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Mar 16 19:10:34 EDT 2020

fix trun parsing

--- a/iso.c
+++ b/iso.c
@@ -248,7 +248,6 @@
 	int i, n, eof;
 	s32int s32i;
 	u64int u;
-	u32int sz;
 
 	if(b->type == BoxFtyp){
 		eBread(8, "brand and version");
@@ -370,27 +369,19 @@
 			eBread(4, "first_sample_flags");
 			b->trun.firstsampleflags = bu32(d);
 		}
-		/* FIXME free those after */
 		b->trun.samples = calloc(b->trun.samplecount, sizeof(RunSample));
 		for(u = 0; u < b->trun.samplecount; u++){
-			fprint(2, "sample %zd\n", u);
-			sz = defsamplesize;
 			if(b->flags & 0x100){
 				eBread(4, "sample_duration");
 				b->trun.samples[u].duration = bu32(d);
-				sz -= 4;
 			}
 			if(b->flags & 0x200){
 				eBread(4, "sample_size");
 				b->trun.samples[u].size = bu32(d);
-				sz = b->trun.samples[u].size - 4;
-				if(b->flags & 0x100)
-					sz -= 4;
 			}
 			if(b->flags & 0x400){
 				eBread(4, "sample_flags");
 				b->trun.samples[u].flags = bu32(d);
-				sz -= 4;
 			}
 			if(b->flags & 0x800){
 				eBread(4, "sample_composition_time_offset");
@@ -399,12 +390,6 @@
 					b->trun.samples[u].timeoffset = bu32(d);
 				else
 					b->trun.samples[u].timeoffset = s32i;
-				sz -= 4;
-			}
-			fprint(2, "left %ud\n", sz);
-			if(Bseek(f, sz, 1) < 0){
-				werrstr("seek");
-				goto err;
 			}
 		}
 		printbox(b);