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 6E45C461F5 for ; Thu, 8 Jun 2023 17:18:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 63F0E68C302; Thu, 8 Jun 2023 20:18:34 +0300 (EEST) Received: from mail-01-1.mymagenta.at (mail-01-1.mymagenta.at [80.109.253.246]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 18D22689D6F for ; Thu, 8 Jun 2023 20:18:28 +0300 (EEST) Received: from [192.168.232.136] (helo=ren-mail-psmtp-mg02.) by mail-01.mymagenta.at with esmtp (Exim 4.93) (envelope-from ) id 1q7JHG-003tgd-EE for ffmpeg-devel@ffmpeg.org; Thu, 08 Jun 2023 19:18:26 +0200 Received: from localhost ([84.115.40.24]) by ren-mail-psmtp-mg02. with ESMTP id 7JHHqT0jobZLD7JHHqqQSa; Thu, 08 Jun 2023 19:18:27 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 84.115.40.24 X-CNFS-Analysis: v=2.4 cv=Ufwy9IeN c=1 sm=1 tr=0 ts=64820d63 a=4thelYDX6rwh+ygQwvsI+Q==:117 a=4thelYDX6rwh+ygQwvsI+Q==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=NEAV23lmAAAA:8 a=oW1aMXZbcGzkY8OzWQ0A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 8 Jun 2023 19:18:23 +0200 Message-Id: <20230608171825.6575-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4xfBuTGCQv6SrJKgXaiKifUTMah0QrL6FmLZS4OkmWSzKcWcvQQTDi2XzsDiPkko3PNhdwflK5zkrBwUXppJIsi9MPsXe1lOO3Lgp58b1s93FQy4+ygvYp yr3iRVxWdpLRrOABdKYTLSH6sJFXvwMKc/FCOXlafi++ErNYDAt3HjxIt8DkoA3tR3TX46x3hotULA== Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/rka: use unsigned for buf0 additions 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 MIME-Version: 1.0 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: signed integer overflow: -38912000 + -2109276160 cannot be represented in type 'int' Fixes: 59670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-4987563245699072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/rka.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/rka.c b/libavcodec/rka.c index 76dca52602..d56f4faee4 100644 --- a/libavcodec/rka.c +++ b/libavcodec/rka.c @@ -735,10 +735,10 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns ctx->buf1[off] = (val + (sum >> bits)) * (1U << bits) + (((1U << bits) - 1U) & ctx->buf1[off + -1]); } - ctx->buf0[off] = ctx->buf1[off] + ctx->buf0[off + -1]; + ctx->buf0[off] = ctx->buf1[off] + (unsigned)ctx->buf0[off + -1]; } else { val *= 1U << ctx->cmode; - sum += ctx->buf0[off + -1] + val; + sum += ctx->buf0[off + -1] + (unsigned)val; switch (s->bps) { case 16: sum = av_clip_int16(sum); break; case 8: sum = av_clip_int8(sum); break; -- 2.17.1 _______________________________________________ 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".