diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-25 12:58:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-25 12:58:31 +0100 |
commit | 875f88318506a89ed3896221398d49f8e3f20b8f (patch) | |
tree | 02f70a44db47387d85b6fcaf0806cb2c6ae9d926 /libavcodec/vorbisdec.c | |
parent | f7dc6aa5fecf26618d54f5a15b06e91d7d7db39c (diff) | |
parent | 23bd9ef4b209c789d5473d75f89a2e411d343d80 (diff) | |
download | ffmpeg-875f88318506a89ed3896221398d49f8e3f20b8f.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
vorbisdec: Accept 0 amplitude_bits
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vorbisdec.c')
-rw-r--r-- | libavcodec/vorbisdec.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 0e6aae1d7f..ab14c9a56c 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -608,13 +608,6 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) 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 */ - if (!floor_setup->data.t0.amplitude_bits) { - av_log(vc->avccontext, AV_LOG_ERROR, - "Floor 0 amplitude bits 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; @@ -1065,6 +1058,9 @@ static int vorbis_floor0_decode(vorbis_context *vc, unsigned amplitude, book_idx; unsigned blockflag = vc->modes[vc->mode_number].blockflag; + if (!vf->amplitude_bits) + return 1; + amplitude = get_bits(&vc->gb, vf->amplitude_bits); if (amplitude > 0) { float last = 0; |