aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-05 02:21:54 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-12 22:42:42 +0200
commit06f01d9fa0ecfa7dd785b3dfe2957999472930b2 (patch)
tree4e3fd3f6d15713d21091a76e9b392b908a2777ca /libavcodec
parent371265f0ec7fc0687da4b62c98b2bae97d43cf64 (diff)
downloadffmpeg-06f01d9fa0ecfa7dd785b3dfe2957999472930b2.tar.gz
avcodec/mlpenc: Use 64 for ml, mr
Fixes: CID1604429 Overflowed constant Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mlpenc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index 67e0e109aa..06670de456 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -1414,7 +1414,8 @@ static int estimate_coeff(MLPEncodeContext *ctx, MLPSubstream *s,
int32_t maxl = INT32_MIN, maxr = INT32_MIN, minl = INT32_MAX, minr = INT32_MAX;
int64_t summ = 0, sums = 0, suml = 0, sumr = 0, enl = 0, enr = 0;
const int shift = 14 - ctx->rematrix_precision;
- int32_t cf0, cf1, e[4], d[4], ml, mr;
+ int32_t cf0, cf1, e[4], d[4];
+ int64_t ml, mr;
int i, count = 0;
for (int j = 0; j <= ctx->cur_restart_interval; j++) {
@@ -1447,8 +1448,8 @@ static int estimate_coeff(MLPEncodeContext *ctx, MLPSubstream *s,
summ -= FFABS(suml + sumr);
sums -= FFABS(suml - sumr);
- ml = maxl - minl;
- mr = maxr - minr;
+ ml = maxl - (int64_t)minl;
+ mr = maxr - (int64_t)minr;
if (!summ && !sums)
return 0;