comparison vorbis_dec.c @ 12341:ad24cca213ae libavcodec

vorbisdec: change a uint_fast32_t to 'unsigned', fix llvm-gcc build
author mru
date Mon, 02 Aug 2010 20:35:50 +0000
parents e2d6add92a73
children bc21b45eba99
comparison
equal deleted inserted replaced
12340:2d15f62f4f8a 12341:ad24cca213ae
95 95
96 typedef struct { 96 typedef struct {
97 uint_fast16_t type; 97 uint_fast16_t type;
98 uint_fast32_t begin; 98 uint_fast32_t begin;
99 uint_fast32_t end; 99 uint_fast32_t end;
100 uint_fast32_t partition_size; 100 unsigned partition_size;
101 uint_fast8_t classifications; 101 uint_fast8_t classifications;
102 uint_fast8_t classbook; 102 uint_fast8_t classbook;
103 int_fast16_t books[64][8]; 103 int_fast16_t books[64][8];
104 uint_fast8_t maxpass; 104 uint_fast8_t maxpass;
105 uint_fast16_t ptns_to_read; 105 uint_fast16_t ptns_to_read;
653 res_setup->partition_size = get_bits(gb, 24) + 1; 653 res_setup->partition_size = get_bits(gb, 24) + 1;
654 /* Validations to prevent a buffer overflow later. */ 654 /* Validations to prevent a buffer overflow later. */
655 if (res_setup->begin>res_setup->end || 655 if (res_setup->begin>res_setup->end ||
656 res_setup->end > vc->avccontext->channels * vc->blocksize[1] / (res_setup->type == 2 ? 1 : 2) || 656 res_setup->end > vc->avccontext->channels * vc->blocksize[1] / (res_setup->type == 2 ? 1 : 2) ||
657 (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) { 657 (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
658 av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %"PRIdFAST16", %"PRIdFAST32", %"PRIdFAST32", %"PRIdFAST32", %"PRIdFAST32"\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1] / 2); 658 av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %"PRIdFAST16", %"PRIdFAST32", %"PRIdFAST32", %u, %"PRIdFAST32"\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1] / 2);
659 return -1; 659 return -1;
660 } 660 }
661 661
662 res_setup->classifications = get_bits(gb, 6) + 1; 662 res_setup->classifications = get_bits(gb, 6) + 1;
663 GET_VALIDATED_INDEX(res_setup->classbook, 8, vc->codebook_count) 663 GET_VALIDATED_INDEX(res_setup->classbook, 8, vc->codebook_count)