diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 79ea37316c..8db25fdae9 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -30,6 +30,7 @@ #include #include +#include "libavutil/intmath.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "dsputil.h" @@ -907,8 +908,9 @@ static int decode_blockcode(int code, int levels, int *values) int offset = (levels - 1) >> 1; for (i = 0; i < 4; i++) { - values[i] = (code % levels) - offset; - code /= levels; + int div = FASTDIV(code, levels); + values[i] = code - offset - div*levels; + code = div; } if (code == 0)