wavpack: check ch_offset

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-13 01:05:04 +01:00
parent e9cb533fbb
commit 580021cfc4
1 changed files with 5 additions and 0 deletions

View File

@ -789,6 +789,11 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
return -1; 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->decorr, 0, MAX_TERMS * sizeof(Decorr));
memset(s->ch, 0, sizeof(s->ch)); memset(s->ch, 0, sizeof(s->ch));
s->extra_bits = 0; s->extra_bits = 0;