Revision ed1d1129 libavcodec/aacsbr.c

View differences:

libavcodec/aacsbr.c
628 628
        if (ch_data->bs_num_env[1] == 1)
629 629
            ch_data->bs_amp_res = 0;
630 630

  
631
        if (ch_data->bs_num_env[1] > 4) {
632
            av_log(ac->avccontext, AV_LOG_ERROR,
633
                   "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
634
                   ch_data->bs_num_env[1]);
635
            return -1;
636
        }
637

  
631 638
        ch_data->bs_pointer = 0;
632 639

  
633 640
        ch_data->bs_freq_res[1] = get_bits1(gb);
......
666 673
        ch_data->bs_num_rel[1]  = get_bits(gb, 2);
667 674
        ch_data->bs_num_env[1]  = ch_data->bs_num_rel[0] + ch_data->bs_num_rel[1] + 1;
668 675

  
676
        if (ch_data->bs_num_env[1] > 5) {
677
            av_log(ac->avccontext, AV_LOG_ERROR,
678
                   "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
679
                   ch_data->bs_num_env[1]);
680
            return -1;
681
        }
682

  
669 683
        for (i = 0; i < ch_data->bs_num_rel[0]; i++)
670 684
            ch_data->bs_rel_bord[0][i] = 2 * get_bits(gb, 2) + 2;
671 685
        for (i = 0; i < ch_data->bs_num_rel[1]; i++)
......
683 697
               ch_data->bs_pointer);
684 698
        return -1;
685 699
    }
686
    if (ch_data->bs_frame_class == FIXFIX && ch_data->bs_num_env[1] > 4) {
687
        av_log(ac->avccontext, AV_LOG_ERROR,
688
               "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
689
               ch_data->bs_num_env[1]);
690
        return -1;
691
    }
692
    if (ch_data->bs_frame_class == VARVAR && ch_data->bs_num_env[1] > 5) {
693
        av_log(ac->avccontext, AV_LOG_ERROR,
694
               "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
695
               ch_data->bs_num_env[1]);
696
        return -1;
697
    }
698 700

  
699 701
    ch_data->bs_num_noise = (ch_data->bs_num_env[1] > 1) + 1;
700 702

  

Also available in: Unified diff