diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 071e2be72c..2bd77835b4 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1016,7 +1016,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, if (wc->ch_offset + s->stereo >= avctx->channels) { av_log(avctx, AV_LOG_WARNING, "Too many channels coded in a packet.\n"); - return (avctx->err_recognition & AV_EF_EXPLODE) ? AVERROR_INVALIDDATA : 0; + return ((avctx->err_recognition & AV_EF_EXPLODE) || !wc->ch_offset) ? AVERROR_INVALIDDATA : 0; } samples_l = frame->extended_data[wc->ch_offset];