diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-25 12:18:43 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-25 12:22:18 +0100 |
commit | cb72f698fe5d85f43fa33628718d450dbd066d1c (patch) | |
tree | c43d6cc345bb0e68c0bdd21f840e90bbfba9746e /libavcodec | |
parent | bb7bc3443dd94ed3a1aa265ff1e9d4b49e78e428 (diff) | |
parent | 11dcecfcca0eca1a571792c4fa3c21fb2cfddddc (diff) | |
download | ffmpeg-cb72f698fe5d85f43fa33628718d450dbd066d1c.tar.gz |
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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/alpha/dsputil_alpha.h | 1 | ||||
-rw-r--r-- | libavcodec/vorbisdec.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/alpha/dsputil_alpha.h b/libavcodec/alpha/dsputil_alpha.h index 16f2d5e6b3..cf5ca3b6bf 100644 --- a/libavcodec/alpha/dsputil_alpha.h +++ b/libavcodec/alpha/dsputil_alpha.h @@ -19,6 +19,7 @@ #ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H #define AVCODEC_ALPHA_DSPUTIL_ALPHA_H +#include <stddef.h> #include <stdint.h> void ff_simple_idct_axp(int16_t *block); diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 645673c0c6..5b1121ce27 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -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.rate = 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); /* zero would result in a div by zero later * * 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"); 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.num_books = get_bits(gb, 4) + 1; |