diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 6caba6a913..aba63ce74b 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1198,7 +1198,7 @@ static av_always_inline int predictor_update_filter(APEPredictor64 *p, if (compression_level < COMPRESSION_LEVEL_INSANE) { predictionA = (int32_t)predictionA; predictionB = (int32_t)predictionB; - p->lastA[filter] = decoded + ((int32_t)(predictionA + (predictionB >> 1)) >> 10); + p->lastA[filter] = (int32_t)(decoded + (unsigned)((int32_t)(predictionA + (predictionB >> 1)) >> 10)); } else { p->lastA[filter] = decoded + ((int64_t)((uint64_t)predictionA + (predictionB >> 1)) >> 10); }