diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-09-10 20:52:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-10 20:52:48 +0200 |
commit | 7db7eb08e051d0d95215f645e0cfa9a5879cded0 (patch) | |
tree | 62fb724f4bc8fd03e521ef797d42e61708310f14 /libavcodec/wavpack.c | |
parent | 60599c68b04ec9d8b09750dd3f45f6ce92e61d35 (diff) | |
parent | 8bfea4ab4e2cb32bc7bf6f697ee30a238c65d296 (diff) | |
download | ffmpeg-7db7eb08e051d0d95215f645e0cfa9a5879cded0.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
Fixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.
avconv: move audio_channels to the options context.
avconv: move *_disable to options context.
avconv: remove -[vas]lang options.
avconv: move codec tags to options context.
cljr: init_get_bits size in bits instead of bytes
indeo2: fail if input buffer too small
indeo2: init_get_bits size in bits instead of bytes
ffv1: Fixed size given to init_get_bits() in decoder.
Conflicts:
avconv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r-- | libavcodec/wavpack.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 582e2cf8c0..253a9560f8 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -863,12 +863,13 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, } switch(id & WP_IDF_MASK){ case WP_ID_DECTERMS: - s->terms = size; - if(s->terms > MAX_TERMS){ + if(size > MAX_TERMS){ av_log(avctx, AV_LOG_ERROR, "Too many decorrelation terms\n"); + s->terms = 0; buf += ssize; continue; } + s->terms = size; for(i = 0; i < s->terms; i++) { s->decorr[s->terms - i - 1].value = (*buf & 0x1F) - 5; s->decorr[s->terms - i - 1].delta = *buf >> 5; |