Ignore:
Timestamp:
04/16/07 00:04:49 (18 years ago)
Author:
r2d
Message:

be sure allocated size is at least used size !

File:
1 edited

Legend:

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

    r266 r267  
    227227        d->seek_table_size = (mpc_uint32_t) tmp;
    228228        d->seek_pwr = d->si.block_pwr + mpc_bits_read(&r, 4);
    229         d->seek_table = malloc((size_t)(2 + d->si.samples / (MPC_FRAME_LENGTH << d->seek_pwr)) * sizeof(mpc_uint32_t));
     229        tmp = 2 + d->si.samples / (MPC_FRAME_LENGTH << d->seek_pwr);
     230        if (tmp < d->seek_table_size) tmp = d->seek_table_size;
     231        d->seek_table = malloc((size_t)(tmp * sizeof(mpc_uint32_t)));
    230232
    231233        table = d->seek_table;
Note: See TracChangeset for help on using the changeset viewer.