diff --git a/libavcodec/wavpack.h b/libavcodec/wavpack.h index a1b46d5bd7..0196574aab 100644 --- a/libavcodec/wavpack.h +++ b/libavcodec/wavpack.h @@ -171,6 +171,8 @@ static av_always_inline int wp_exp2(int16_t val) res = wp_exp2_table[val & 0xFF] | 0x100; val >>= 8; + if (val > 31) + return INT_MIN; res = (val > 9) ? (res << (val - 9)) : (res >> (9 - val)); return neg ? -res : res; }