Revision 0c5670a0 libavcodec/mlpdec.c

View differences:

libavcodec/mlpdec.c
433 433
                              unsigned int channel, unsigned int filter)
434 434
{
435 435
    FilterParams *fp = &m->channel_params[channel].filter_params[filter];
436
    const int max_order = filter ? MAX_IIR_ORDER : MAX_FIR_ORDER;
436 437
    const char fchar = filter ? 'I' : 'F';
437 438
    int i, order;
438 439

  
......
440 441
    assert(filter < 2);
441 442

  
442 443
    order = get_bits(gbp, 4);
443
    if (order > MAX_FILTER_ORDER) {
444
    if (order > max_order) {
444 445
        av_log(m->avctx, AV_LOG_ERROR,
445 446
               "%cIR filter order %d is greater than maximum %d.\n",
446
               fchar, order, MAX_FILTER_ORDER);
447
               fchar, order, max_order);
447 448
        return -1;
448 449
    }
449 450
    fp->order = order;
......
651 652
                           unsigned int channel)
652 653
{
653 654
    SubStream *s = &m->substream[substr];
654
    int32_t filter_state_buffer[NUM_FILTERS][MAX_BLOCKSIZE + MAX_FILTER_ORDER];
655
    int32_t filter_state_buffer[NUM_FILTERS][MAX_BLOCKSIZE + MAX_FIR_ORDER];
655 656
    FilterParams *fp[NUM_FILTERS] = { &m->channel_params[channel].filter_params[FIR],
656 657
                                      &m->channel_params[channel].filter_params[IIR], };
657 658
    unsigned int filter_shift = fp[FIR]->shift;
......
661 662

  
662 663
    for (j = 0; j < NUM_FILTERS; j++) {
663 664
        memcpy(&filter_state_buffer[j][MAX_BLOCKSIZE], &fp[j]->state[0],
664
               MAX_FILTER_ORDER * sizeof(int32_t));
665
               MAX_FIR_ORDER * sizeof(int32_t));
665 666
    }
666 667

  
667 668
    for (i = 0; i < s->blocksize; i++) {
......
690 691

  
691 692
    for (j = 0; j < NUM_FILTERS; j++) {
692 693
        memcpy(&fp[j]->state[0], &filter_state_buffer[j][index],
693
               MAX_FILTER_ORDER * sizeof(int32_t));
694
               MAX_FIR_ORDER * sizeof(int32_t));
694 695
    }
695 696
}
696 697

  

Also available in: Unified diff