Ticket #1316: extract-fix.diff

File extract-fix.diff, 976 bytes (added by eriktorbjorn, 16 years ago)

Untested patch against a November 24 CVS snapshot

  • tools/extract.c

    diff -ur --exclude=CVS ScummVM/tools/extract.c ScummVM+hack/tools/extract.c
    old new  
    5353        fclose(output_idx);
    5454
    5555        output_idx = fopen(oggmode ? OUTPUT_OGG : OUTPUT_MP3, "wb");
    56         writeUint32BE(input, (uint32)idx_size);
     56        writeUint32BE(output_idx, (uint32)idx_size);
    5757
    5858        in = fopen(TEMP_IDX, "rb");
    5959        while ((size = fread(buf, 1, 2048, in)) > 0) {
     
    112112                exit(-1);
    113113        tags -= 8;
    114114
    115         writeUint32BE(input, (uint32)pos);
    116         writeUint32BE(input, (uint32)ftell(output_snd));
    117         writeUint32BE(input, tags);
     115        writeUint32BE(output_idx, (uint32)pos);
     116        writeUint32BE(output_idx, (uint32)ftell(output_snd));
     117        writeUint32BE(output_idx, tags);
    118118        while (tags > 0) {
    119119                fputc(fgetc(input), output_snd);
    120120                tags--;
     
    143143        }
    144144        fclose(f);
    145145
    146         writeUint32BE(input, tot_size);
     146        writeUint32BE(output_idx, tot_size);
    147147}
    148148
    149149void showhelp(char *exename)