X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Fwavpack.c;h=2bda3599a8448e05e6c733bf69d7192f1eaa1a4f;hb=590fb5291ad434889b445e8b8d949daed97db5dd;hp=3d0b01f257c95b58948913924e741b1ea82b6335;hpb=387d96fcf54bb8361195fe8ac2c6688d35d5313f;p=ffmpeg diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 3d0b01f257c..2bda3599a84 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -861,6 +861,12 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, s->and = 1; s->shift = val[3]; } + if (s->shift > 31) { + av_log(avctx, AV_LOG_ERROR, + "Invalid INT32INFO, shift = %d (> 31)\n", s->shift); + s->and = s->or = s->shift = 0; + continue; + } /* original WavPack decoder forces 32-bit lossy sound to be treated * as 24-bit one in order to have proper clipping */ if (s->hybrid && bpp == 4 && s->post_shift < 8 && s->shift > 8) {