diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
index e555482b235deef6159efcb1d43da112b36069a6..1676313b7cb9f87a28bc4e0c4ee66756c86470d5 100644
--- a/libavcodec/takdec.c
+++ b/libavcodec/takdec.c
@@ -491,7 +491,7 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded,
                      s->residues[i + j + 1] * s->filter[j + 1] +
                      s->residues[i + j    ] * s->filter[j    ];
             }
-            v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - *decoded;
+            v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - (unsigned)*decoded;
             *decoded++ = v;
             s->residues[filter_order + i] = v >> dshift;
         }