diff options
-rw-r--r-- | libavcodec/flacenc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index b2b3c84e69..e997bca129 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -499,10 +499,11 @@ static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order, res = &data[pred_order]; res_end = &data[n >> pmax]; for(i=0; i<parts; i++) { - sums[pmax][i] = 0; + uint32_t sum = 0; while(res < res_end){ - sums[pmax][i] += *(res++); + sum += *(res++); } + sums[pmax][i] = sum; res_end+= n >> pmax; } /* sums for lower levels */ |