diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index d2ba97ee2c..87c065c1e7 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -433,8 +433,8 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10); R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10); } else { - L2 = L + ((s->decorr[i].weightA * A + 512) >> 10); - R2 = R + ((s->decorr[i].weightB * B + 512) >> 10); + L2 = L + ((int)(s->decorr[i].weightA * A + 512U) >> 10); + R2 = R + ((int)(s->decorr[i].weightB * B + 512U) >> 10); } if (A && L) s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;