aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vorbisdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-25 12:18:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-25 12:22:18 +0100
commitcb72f698fe5d85f43fa33628718d450dbd066d1c (patch)
treec43d6cc345bb0e68c0bdd21f840e90bbfba9746e /libavcodec/vorbisdec.c
parentbb7bc3443dd94ed3a1aa265ff1e9d4b49e78e428 (diff)
parent11dcecfcca0eca1a571792c4fa3c21fb2cfddddc (diff)
downloadffmpeg-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/vorbisdec.c')
-rw-r--r--libavcodec/vorbisdec.c9
1 files changed, 5 insertions, 4 deletions
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;