Ignore:
Timestamp:
09/23/06 20:59:08 (18 years ago)
Author:
zorg
Message:

Fix header overwrite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mppenc/branches/zorg/src/bitstream.c

    r46 r50  
    115115    if ( fseek ( fp, 22L, SEEK_SET ) < 0 )
    116116        return;
     117    fread ( buff, 1, 2, fp );
     118    if ( ferror(fp) )
     119        return;
     120    if ( fseek ( fp, 22L, SEEK_SET ) < 0 )
     121        return;
    117122
    118123    ValidSamples <<= 4;
    119     ValidSamples  |= 0x8000;
     124    ValidSamples  |= 0x800F & (((Uint) buff[1] << 8) | buff[0]);
    120125    buff [0] = (Uint8_t)(ValidSamples >>  0);
    121126    buff [1] = (Uint8_t)(ValidSamples >>  8);
Note: See TracChangeset for help on using the changeset viewer.