aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-13 01:05:04 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-13 01:11:59 +0100
commit580021cfc45847d9d0fbbbfe4045c40cc56924bf (patch)
tree360ae0d06f8e5852269ffce6979f4fb01ecfc460
parente9cb533fbb90c274cfed07b69ebf5c1989573e20 (diff)
downloadffmpeg-580021cfc45847d9d0fbbbfe4045c40cc56924bf.tar.gz
wavpack: check ch_offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wavpack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 2935abfa8b..b36fa0a28e 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -789,6 +789,11 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
return -1;
}
+ if (wc->ch_offset >= avctx->channels) {
+ av_log(avctx, AV_LOG_ERROR, "too many channels\n");
+ return -1;
+ }
+
memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr));
memset(s->ch, 0, sizeof(s->ch));
s->extra_bits = 0;