diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2015-05-03 01:13:51 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2015-05-03 01:13:51 +0200 |
| commit | 27664a5634d04167b3a5a700a45131f0ffbf162a (patch) | |
| tree | 9ecde92211bc88a6c93e1f2820267376dcc86dc4 /src/export | |
| parent | 1965f3d32fa8bb63965135dc06985a3dec0af81b (diff) | |
Fix amount of chunks passed to decompressor in first page
Diffstat (limited to 'src/export')
| -rw-r--r-- | src/export/extract_version_2.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/export/extract_version_2.c b/src/export/extract_version_2.c index 68b05af..f39bf5d 100644 --- a/src/export/extract_version_2.c +++ b/src/export/extract_version_2.c | |||
| @@ -346,7 +346,7 @@ static void decompress_subchunk( uint8_t * subchunk, size_t subchunk_size, int c | |||
| 346 | err = decomp(&s); | 346 | err = decomp(&s); |
| 347 | if( err ) { | 347 | if( err ) { |
| 348 | for( i=0; i<32; ++i ) fprintf( stderr, "%02X ", s.in[i] ); | 348 | for( i=0; i<32; ++i ) fprintf( stderr, "%02X ", s.in[i] ); |
| 349 | fprintf( stderr, "\nError: %d\n", err ); | 349 | fprintf( stderr, "\nError: %d (%d chunks left at %08x)\n", err, chunks, (unsigned int)(subchunk) ); |
| 350 | return; | 350 | return; |
| 351 | } | 351 | } |
| 352 | 352 | ||
| @@ -384,7 +384,6 @@ int main( int args, char **argv ) { | |||
| 384 | 384 | ||
| 385 | file = map_file( argv[1], 1 ); | 385 | file = map_file( argv[1], 1 ); |
| 386 | if( !file ) exit( 1 ); | 386 | if( !file ) exit( 1 ); |
| 387 | fp = file->addr; | ||
| 388 | 387 | ||
| 389 | num_subchunks = *(uint16_t*)(fp+0x14); | 388 | num_subchunks = *(uint16_t*)(fp+0x14); |
| 390 | subchunk_rest_count = *(uint16_t*)(fp+0x1c); | 389 | subchunk_rest_count = *(uint16_t*)(fp+0x1c); |
| @@ -394,7 +393,7 @@ int main( int args, char **argv ) { | |||
| 394 | decode_19bit_address ( fp + 0x20, offsets, num_subchunks ); | 393 | decode_19bit_address ( fp + 0x20, offsets, num_subchunks ); |
| 395 | offsets[num_subchunks] = file->size; | 394 | offsets[num_subchunks] = file->size; |
| 396 | 395 | ||
| 397 | decompress_subchunk( subchunk, offsets[i], subchunk_one_count, MAXWIN ); | 396 | decompress_subchunk( subchunk, offsets[0], subchunk_one_count + 1, MAXWIN ); |
| 398 | 397 | ||
| 399 | for( i=0; i< num_subchunks; ++i ) | 398 | for( i=0; i< num_subchunks; ++i ) |
| 400 | if( offsets[i] + 0x800 < file->size ) | 399 | if( offsets[i] + 0x800 < file->size ) |
