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 BDD4A4B42A for ; Wed, 5 Jun 2024 13:21:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8D50268D6A6; Wed, 5 Jun 2024 16:21:36 +0300 (EEST) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 46F5768D61F for ; Wed, 5 Jun 2024 16:21:30 +0300 (EEST) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a634e03339dso781286766b.3 for ; Wed, 05 Jun 2024 06:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717593689; x=1718198489; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=uRV83ka+hN7LMXB8ZIhMdMU3eja9ea9Zd8TJuSODOKs=; b=cN3CKhNz6fp+3uGe6rh46O5iAYi+qwMtyG9lmtGsMhVS/kwf/6bcgvjeD1yqaejgNz j0e8XduujBAm438MIRih6WCT+2kKggXt6mAlmaPVZkaOFdP5jeGwsIjqawbaX8g+z48O f2IelHsQ+f/2XAFuh3YguRe5w/YvlEmOsGUPLFwxbLyVC3vzfRDqksYTInuJJ8dtx9Ly sgGzyb4/v7BaCxqGEl+j6VuzOxVW/jsXqtDrUnL34CJAF9KO5Ch5n/UrlWm6xM3tHcaW gqzQ2dovxCAGMuiT6vGSoD2NPnMfMmA0zopr9aw4Bh2ugvNCEB2FVtBJLN9vjlSUODTY jcTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717593689; x=1718198489; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uRV83ka+hN7LMXB8ZIhMdMU3eja9ea9Zd8TJuSODOKs=; b=o8/UFd9BxUUrj0aPara69XWGt1uCuGtjNp80EbRyv3tMJep7HFlIzuid0Z83anAwo2 oHxAsiHFIj9Iz3Y308yVJssbPbRDktXUjYEvs0PzTScWXkKxf0bf85wvo4vSwWIQsJLY nrtETq+idCMYWcRZBR29rlsrgpkjoB8kvkOcyll8Ros5qzZfMOf0LKMMCRNraISsIZSw 8Zc9+RFKMraFPiiiYqVweERiNezKRMSlFcTldvvY7fKKwb6UL6dnPMmkh7paWIpP60nU bhjB/5pm9ppZYDdHiuDNznuiBJ24t9qKMeFITrJEVp1BHupyOXOUbHgtJpPyrz7iMPSF 0OwQ== X-Gm-Message-State: AOJu0YxPa1F8ebkkBOmonRSFC/SIg84DAfeoCtpNFqGijM8mtrHMRPE/ 1kieUTBKcMBKrtOvyULzBjtTJc/mPidp2FPc0uxJfPDTAVFJtyJm2hxnCQ== X-Google-Smtp-Source: AGHT+IEhP6SUzBdQueEzvU+TdAx7wkODnJVTlWEgu5j8+5thg1MtAoBZwwra4IFAQrxxhoS0CGey2A== X-Received: by 2002:a17:906:178a:b0:a5a:6bde:c3fb with SMTP id a640c23a62f3a-a699fa9d32dmr140701366b.28.1717593688741; Wed, 05 Jun 2024 06:21:28 -0700 (PDT) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a68f76cd1fbsm509601266b.223.2024.06.05.06.21.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 06:21:28 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 4F4E9BFCE8; Wed, 5 Jun 2024 15:21:27 +0200 (CEST) Date: Wed, 5 Jun 2024 15:21:27 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <20240604222835.166462-1-marcus@marcusspencer.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH v6] avcodec: add farbfeld encoder 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: On date Wednesday 2024-06-05 13:14:01 +0200, Andreas Rheinhardt wrote: > Stefano Sabatini: [...] > >> One does not need two checks as long as int is 32 bits (because then one > >> can just perform the addition in 64bits). > > > > sizeof(int) is not defined by the C standard, so you cannot assume it > > is 32 bits (even if on most platforms/compilers it will be) > > > > Did you even read the following? It handles the case where simply using > 64bits is not enough. Yes, but there is no need to mix types, introduce ifdeffery and make more assumptions when there is a simpler solution, please let's stick at that. > >> Just use the following (#if > >> has been used because compilers have a tendency to emit warnings if a > >> particular check is tautologically false): > >> > >> #if INT_MAX > INT64_MAX - HEADER_SIZE > >> if (raw_img_size > INT64_MAX - HEADER_SIZE) > >> return AVERROR(ERANGE); > >> #endif _______________________________________________ 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".