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 B61D2490E9 for ; Mon, 3 Jun 2024 12:11:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7612668D667; Mon, 3 Jun 2024 15:11:09 +0300 (EEST) Received: from glom.nmugroup.com (glom.nmugroup.com [193.183.80.6]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D96C468D4A8 for ; Mon, 3 Jun 2024 15:11:02 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by glom.nmugroup.com (Postfix) with ESMTP id C276654289DD for ; Mon, 3 Jun 2024 14:11:00 +0200 (CEST) Received: from debian.lan (unknown [IPv6:2a00:66c0:a::72c]) (Authenticated sender: git01) by glom.nmugroup.com (Postfix) with ESMTPSA id 8A58D5425CC6 for ; Mon, 3 Jun 2024 14:11:00 +0200 (CEST) Message-ID: From: Tomas =?ISO-8859-1?Q?H=E4rdin?= To: FFmpeg development discussions and patches Date: Mon, 03 Jun 2024 14:10:59 +0200 In-Reply-To: <20240603033321.357618-1-marcus@marcusspencer.xyz> References: <20240603033321.357618-1-marcus@marcusspencer.xyz> User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2] 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: This format seems to reproduce some of the same issues as QOI: > The RGB-data should be sRGB for best interoperability and not alpha- > premultiplied. This seems to imply it could be something other than sRGB since it says SHOULD rather than MUST. This probably isn't a huge issue, but it should be clearer on the website. It also doesn't say whether alpha is linear or not. > + int pkt_size = HEADER_SIZE + av_image_get_buffer_size( > + p->format, > + p->width, > + p->height, > + 1 > + ); Check the return value of av_image_get_buffer_size() before adding HEADER_SIZE to it. There will be a signed overflow (UB) for images of size 16385x16385 (and many others). Aside: av_image_get_buffer_size() will UB for sizes above INT_MAX because the size_t's in sizes[] get accumulated into an int. Besides the UB it also returns incorrect values. /Tomas _______________________________________________ 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".