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 A3D9B4AD5A for ; Tue, 21 May 2024 02:47:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1444B68D2C7; Tue, 21 May 2024 05:47:10 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 02BFD68D2B5 for ; Tue, 21 May 2024 05:47:01 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2C166C0002 for ; Tue, 21 May 2024 02:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716259621; 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=F5PYDkDowZ7Fqax9/Sj+kDFoGzf7PL7APnLMV6K6B6g=; b=kRMOkA9NCfNIn/6gxga1jB26NqQYZpV31DXV07cpIpVtE8PsGTPCPhnkKNfGhS336KOhS5 Ci83cjLBYnevcoOv6HQ/C3S8WlA9+s4qvBrtlnOhQf/4Z0JQZv0/Tg7WUPBQlABfFAKfPs aA0MscgQbWQVSvdNcF8+hefjxeh/V+uLcOA4Bca0b4XtCTyRekCpcy85X11bUVDpwAt5Gm kYlOEz2iSk6Ol+XjDaVFn6uS2eWyUrDhp5tI0xskYw/mhnkmiPkLHgVK7uwKAikVQPzsar SlZh9/wrQtOMOC9cveI7AjWm6pBonGpZa0xN6hm5DcCsEss3AxwKTsmbL1zX0A== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 21 May 2024 04:46:52 +0200 Message-ID: <20240521024652.1006233-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240521024652.1006233-1-michael@niedermayer.cc> References: <20240521024652.1006233-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 7/7] tools/enc_recon_frame_test: Assert that av_image_get_linesize() succeeds 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: Helps: CID1524598 Improper use of negative value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- tools/enc_recon_frame_test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/enc_recon_frame_test.c b/tools/enc_recon_frame_test.c index c099beb3f4b..d39d6303c2e 100644 --- a/tools/enc_recon_frame_test.c +++ b/tools/enc_recon_frame_test.c @@ -28,6 +28,7 @@ #include "decode_simple.h" #include "libavutil/adler32.h" +#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/error.h" #include "libavutil/frame.h" @@ -89,6 +90,8 @@ static int frame_hash(FrameChecksum **pc, size_t *nb_c, int64_t ts, int linesize = av_image_get_linesize(frame->format, frame->width, p); uint32_t checksum = 0; + av_assert1(linesize >= 0); + for (int j = 0; j < frame->height >> shift_v[p]; j++) { checksum = av_adler32_update(checksum, data, linesize); data += frame->linesize[p]; -- 2.45.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".