Ignore:
Timestamp:
11/25/06 16:05:21 (18 years ago)
Author:
r2d
Message:
  • corrected a memory allocation bug
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/libmpcdec/mpc_demux.c

    r151 r152  
    156156        if (d->si.block_pwr > d->seek_pwr)
    157157                d->seek_pwr = d->si.block_pwr;
    158         d->seek_table = malloc((size_t)(1 + d->si.samples / (MPC_FRAME_LENGTH << d->seek_pwr)) * sizeof(mpc_uint32_t));
     158        d->seek_table = malloc((size_t)(2 + d->si.samples / (MPC_FRAME_LENGTH << d->seek_pwr)) * sizeof(mpc_uint32_t));
    159159        if (d->seek_table == 0)
    160160                return MPC_STATUS_FILE;
     
    178178        d->seek_table_size = (mpc_uint32_t) tmp;
    179179        d->seek_pwr = d->si.block_pwr + mpc_bits_read(&r, 4);
    180         d->seek_table = malloc((size_t)(1 + d->si.samples / (MPC_FRAME_LENGTH << d->seek_pwr)) * sizeof(mpc_uint32_t));
     180        d->seek_table = malloc((size_t)(2 + d->si.samples / (MPC_FRAME_LENGTH << d->seek_pwr)) * sizeof(mpc_uint32_t));
    181181
    182182        table = d->seek_table;
Note: See TracChangeset for help on using the changeset viewer.