From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 2469A4B399 for ; Fri, 5 Jul 2024 00:23:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9BA9A68DB0A; Fri, 5 Jul 2024 03:22:24 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 05EB368DA9B for ; Fri, 5 Jul 2024 03:22:07 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3A9661BF203 for ; Fri, 5 Jul 2024 00:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720138927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vn0NNsk4RmqyH0BfAVtDhSAVV2Q27wSfSzagq5l8F3I=; b=E7Ua8qiuyQihLQoTrmh/1UYC9C3EKqCLnkQR8hpu7vlw1OujgSVZp5Pn4juLASvwm0KxeZ gpfQ/69KQ5pl7izKMlqfnhpvxDA5qNLYXqYQR2YcogkRu5xn2kM4MJX2Pr2Y9nhs3DVlId M2uOOeBGdgLmvNJ/AB/3hznmMmlfHCML+dQJl4W2il8xYD/fjuoxI37LdyG0DZcx7cRIuE 5p0BOi/SXWLuuY/kI2Dwew2uEUJn2Y5lE8sZTJh5ezbRaKkBAD/dyIVM/lOd7M9UuOyu8+ OyfVKka1EJC+ZEoDfJ26CgMQsi4++2Nsed8sWeEMi7ItjvV0rEAHfSW/MXDkEg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 5 Jul 2024 02:21:54 +0200 Message-ID: <20240705002156.1964272-13-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240705002156.1964272-1-michael@niedermayer.cc> References: <20240705002156.1964272-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 13/15] avcodec/mlpenc: Use 64 for ml, mr X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: CID1604429 Overflowed constant Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/mlpenc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index 67e0e109aa0..06670de456e 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; -- 2.45.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".