2
0
mirror of https://github.com/vasi/pixz synced 2024-11-18 15:26:46 +00:00

Reading multiple indices ok!

This commit is contained in:
Dave Vasilevsky 2012-11-04 20:11:49 -05:00
parent 28e0515d75
commit 4ef79b67d6

View File

@ -259,7 +259,7 @@ static off_t stream_padding(bw *b, off_t pos) {
b->pos = pos; b->pos = pos;
b->size = 0; b->size = 0;
for (off_t pad = 0; true; ++pad) { for (off_t pad = 0; true; pad += sizeof(uint32_t)) {
uint32_t *i = bw_read(b); uint32_t *i = bw_read(b);
if (!i) if (!i)
die("Error reading stream padding"); die("Error reading stream padding");
@ -333,7 +333,13 @@ bool decode_index(void) {
return false; // not seekable return false; // not seekable
off_t pos = ftello(gInFile); off_t pos = ftello(gInFile);
gIndex = next_index(&pos); gIndex = NULL;
while (pos > 0) {
lzma_index *index = next_index(&pos);
if (gIndex && lzma_index_cat(index, gIndex, NULL) != LZMA_OK)
die("Error concatenating indices");
gIndex = index;
}
return true; return true;
} }