[trak] Fix counting

This commit is contained in:
Behdad Esfahbod 2018-10-11 10:30:32 -04:00
parent a5be380cae
commit 451f3de521
1 changed files with 4 additions and 4 deletions

View File

@ -95,10 +95,9 @@ struct TrackData
/* XXX Clean this up. Make it work with nSizes==1 and 0. */ /* XXX Clean this up. Make it work with nSizes==1 and 0. */
unsigned int sizes = nSizes;
const TrackTableEntry *trackTableEntry = nullptr; const TrackTableEntry *trackTableEntry = nullptr;
for (unsigned int i = 0; i < sizes; i++) unsigned int count = nTracks;
for (unsigned int i = 0; i < count; i++)
{ {
/* Note: Seems like the track entries are sorted by values. But the /* Note: Seems like the track entries are sorted by values. But the
* spec doesn't explicitly say that. It just mentions it in the example. */ * spec doesn't explicitly say that. It just mentions it in the example. */
@ -111,9 +110,10 @@ struct TrackData
break; break;
} }
} }
if (!trackTableEntry) return 0.; if (!trackTableEntry) return 0.;
unsigned int sizes = nSizes;
/* TODO bfind() */ /* TODO bfind() */
unsigned int size_index; unsigned int size_index;
UnsizedArrayOf<Fixed> size_table = base+sizeTable; UnsizedArrayOf<Fixed> size_table = base+sizeTable;