Merge commit '11dcecfcca0eca1a571792c4fa3c21fb2cfddddc'

* commit '11dcecfcca0eca1a571792c4fa3c21fb2cfddddc':
  vorbisdec: Error on bark_map_size equal to 0.
  dsputil_alpha.h: Add missing stddef.h header to fix standalone compilation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-25 12:18:43 +01:00
commit cb72f698fe
2 changed files with 6 additions and 4 deletions

View File

@ -19,6 +19,7 @@
#ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H #ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H
#define AVCODEC_ALPHA_DSPUTIL_ALPHA_H #define AVCODEC_ALPHA_DSPUTIL_ALPHA_H
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
void ff_simple_idct_axp(int16_t *block); void ff_simple_idct_axp(int16_t *block);

View File

@ -592,6 +592,11 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
floor_setup->data.t0.order = get_bits(gb, 8); floor_setup->data.t0.order = get_bits(gb, 8);
floor_setup->data.t0.rate = get_bits(gb, 16); floor_setup->data.t0.rate = get_bits(gb, 16);
floor_setup->data.t0.bark_map_size = get_bits(gb, 16); floor_setup->data.t0.bark_map_size = get_bits(gb, 16);
if (floor_setup->data.t0.bark_map_size == 0) {
av_log(vc->avccontext, AV_LOG_ERROR,
"Floor 0 bark map size is 0.\n");
return AVERROR_INVALIDDATA;
}
floor_setup->data.t0.amplitude_bits = get_bits(gb, 6); floor_setup->data.t0.amplitude_bits = get_bits(gb, 6);
/* zero would result in a div by zero later * /* zero would result in a div by zero later *
* 2^0 - 1 == 0 */ * 2^0 - 1 == 0 */
@ -600,10 +605,6 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
"Floor 0 amplitude bits is 0.\n"); "Floor 0 amplitude bits is 0.\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (floor_setup->data.t0.bark_map_size == 0) {
av_log(vc->avccontext, AV_LOG_ERROR, "Floor 0 bark map size is 0.\n");
return AVERROR_INVALIDDATA;
}
floor_setup->data.t0.amplitude_offset = get_bits(gb, 8); floor_setup->data.t0.amplitude_offset = get_bits(gb, 8);
floor_setup->data.t0.num_books = get_bits(gb, 4) + 1; floor_setup->data.t0.num_books = get_bits(gb, 4) + 1;