From patchwork Thu May 2 00:41:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48461 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f91:b0:1af:7bf4:b644 with SMTP id mm17csp80183pzb; Wed, 1 May 2024 17:42:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUFQTZMyijISsRzbGPfqIEi863w56VV3aAV2W5H9EHTwrKbpVQrYd3l2z2iWVWcguYinnpFyKA88/Ybe3iIp5vP03ciy208iGX/2w== X-Google-Smtp-Source: AGHT+IHN90lVn3BhZ/I8vRuoc2yPL976ct4kSMFgq6M0SFP198BDjMo7BhehiCSai4il2hruzNDn X-Received: by 2002:adf:fe03:0:b0:34c:54c8:3f2d with SMTP id n3-20020adffe03000000b0034c54c83f2dmr3066522wrr.69.1714610538164; Wed, 01 May 2024 17:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714610538; cv=none; d=google.com; s=arc-20160816; b=jjXNCMa8WFP5Hd9MdzP1QrfXH9hzISDwPmoHkl+PiaL14PB2sOwcIFwdMq5fbYpUQI u4q2Y8XvjZIUp+xh7gWLUQC/4qpBZQitza+xhBeELHLaqjcPLD6wYE42Db/H+Ci38i5f YL87yZ232iqA1QGqhP5kFHeMBUrO+zFqZsT7IrUCSXaWl+HAo33WkzxRnuWosnRTEVct iW3OAcvCR6XsZUKMj3bYIPWL5PizYtTB7pInuzK9c0YhaxhlZsPT3ZdSX/cBcZ7SZwQg TGowsRMQYkow6X64dkzuD1FpBb9Hyd0YCIb5f7Wj6Jm4sD7WltVJCkIcr5kK/WL/8mUl adeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=5U5L6Fn1vTBUZD/fGJHLFwqDZ2ccoRW4r0QQFIBT2t8=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=dOrytS0w0z+aX/KWwYJ1/jItDiPg0cd9lZgzvB8WmG8T75x80pGmAlYoxi9JC5RQ9R TFZVAM1yqOBDqjUV7tLjTalFJm1lkW9VevXH/BYNvLewr6JNopQHItVwjb4T132hEj/l tWJ3yFzPC5vx7zD/bbj88D9i79Cd/ZN1eYfOVG53G7uJbyAEzU1NVLwdL7rppm3Y9Xpl u56vxJQzDMDI2BciLKWy00QgILr5S6gLrPsw84Cpz/QvKvZAGhHZe9JvgHCJwGpoyVyC jprXEm3s5ZBB+/mtK2ymuug0e/GfBgux4Wwy3CM1pdbuGUyEzHJuE309jpXUCfEw3EjH Ja1Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="n/urv93J"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v6-20020a1709064e8600b00a58c55d46ebsi7170208eju.803.2024.05.01.17.42.05; Wed, 01 May 2024 17:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="n/urv93J"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D10F868D6EA; Thu, 2 May 2024 03:41:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 92CAE68D6EA for ; Thu, 2 May 2024 03:41:52 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7B3ACFF804 for ; Thu, 2 May 2024 00:41:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714610511; 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; bh=1sg9NpDdTuW5DX9Ee9JQvIxdrMyoOCql6W0pn1zrVyw=; b=n/urv93Jou3hmcz4b0zlY17X5wzI8UmTzaSREZfmPBvtdYapWd9TKNQseDrm/IVcSaJj9S muU5awL1DqXP89k23ZM0bmSNYFerCuMeV3gqterGkDebaEv9Zo2kieVA7tfWpoVpAoY3u+ AVLubnHT2wyYmP9nJqqu1kvPUTXcBduUQBSx9TOilViyH8oMZpGYcupMUtgpBrJev6RfP7 qbF/3vrBBidjFeZ3i1oEBHfcVi+h3Kzg6ehH54N25FWG6xv5jPUrHl4HEYtJLCEzm7d3Mk Teqn32fjYlQKutoZRaM4ZpwZRl9lb+YL4j8r7ZG3SAEY3fkf3/csLp+9aaChMA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 2 May 2024 02:41:44 +0200 Message-ID: <20240502004150.3627661-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/7] avcodec/av1dec: bit_depth cannot be another values than 8, 10, 12 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 93YuzTcmA+O8 Fixes: CID1544265 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/av1dec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 79a30a114da..4f9222cca27 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -493,7 +493,7 @@ static enum AVPixelFormat get_sw_pixel_format(void *logctx, else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV444P12; else - av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_assert0(0); } else if (seq->color_config.subsampling_x == 1 && seq->color_config.subsampling_y == 0) { if (bit_depth == 8) @@ -503,7 +503,7 @@ static enum AVPixelFormat get_sw_pixel_format(void *logctx, else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV422P12; else - av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_assert0(0); } else if (seq->color_config.subsampling_x == 1 && seq->color_config.subsampling_y == 1) { if (bit_depth == 8) @@ -513,7 +513,7 @@ static enum AVPixelFormat get_sw_pixel_format(void *logctx, else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV420P12; else - av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_assert0(0); } } else { if (bit_depth == 8) @@ -523,7 +523,7 @@ static enum AVPixelFormat get_sw_pixel_format(void *logctx, else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_GRAY12; else - av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_assert0(0); } return pix_fmt; From patchwork Thu May 2 00:41:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48460 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f91:b0:1af:7bf4:b644 with SMTP id mm17csp80179pzb; Wed, 1 May 2024 17:42:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU2CX5+H2D8/26xCt4a6g1gfxKA7urMJwxVvtmJ/SegHWAEIWNAa/cruGEfvPvLJsDskdMIOp3CKKvNIVU6wnFrKy3vc/VWiDz7nQ== X-Google-Smtp-Source: AGHT+IFHANg+FHkw5LhVmsSQe9mXti5zTYPsrMEEw+EZz6xXkDJiyDVNCZQBfvv5Btb9yc2AKkqJ X-Received: by 2002:a05:6512:132a:b0:51d:82a2:8d72 with SMTP id x42-20020a056512132a00b0051d82a28d72mr2468026lfu.40.1714610537361; Wed, 01 May 2024 17:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714610537; cv=none; d=google.com; s=arc-20160816; b=ecNoGAJm6JvXlwkhRSsLhCbHWesF8ZWxshOkN0cgMjqN8tZCJZDwGwKLFH9ngtw/7O rx3reGMRpJg8zfVNvpF3SAuecZNYB3A7a2zgC6uob046z1mIE4uc2Q5nEJkAkjRTWkhc wl8sOH/K3Z55SZ+Mdkz1i0ZY15PJgv2W0v+nU9GVFxjZon/NnbB6a/SqH/9eGHxqzbtF JSlcZ1z+iFk23mj3gaHHZSBsJ6hHiqN6v439JHiyVqC7FAwTl15/8ltQwidzw0DK3cJ1 RDFiqX+6ZWbW/A3DSbHMYE3PDBK0hp7SiaidCJSDdrzsm9bQiOUcA3atTATO+KkB8s8f dMQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=bZ+i6elW4heGaZ1ozN+hxmb+h9PhN5VSSYQiggAsy3k=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=zISvIQHI2lSgNYID6SlcaoSdWlLyNrhAmiSBD1XSiYJyfvaFXcPfXfg0iUVCQA+xON jAjvOJuUyc2DerGFJIxi5WRe8KB2EuHTq+j1lkMlwqi5sxzQut2+gqpnL7xtthqDPB4Q OWQVv5VX4Ay2hk9Lhki4DQwFyirryz/KV9ruLaGwzufg+C3kiz0DYI7vgT1T7RcNW3yY qxKp7LWwOSZxccqLZl9q/3TytFchbPolwO5ZY1NOunc2T0HQf1xXZos63rBwbJxLsfJz QXWL4aIlhlJXgGsYQrcjG8IVPHX0OwygDPstpLQFuQODavYbnQggng4c4Rw5B4Ba4giv BL+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=Ucm8v6vI; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qa10-20020a170907868a00b00a594314f627si1523367ejc.825.2024.05.01.17.42.17; Wed, 01 May 2024 17:42:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=Ucm8v6vI; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E2A5768D766; Thu, 2 May 2024 03:42:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 47FD968D6EA for ; Thu, 2 May 2024 03:41:53 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7DE66C0004 for ; Thu, 2 May 2024 00:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714610512; 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=/6zywNQYDHYDpmIVabx0aBWT0PfRRaB9tWE0DO2YqEQ=; b=Ucm8v6vIGObFIQfjg4XVKdCWm3Bzrx1VU3LwyBD6taGqyDqaUIY8/cvjeNezQH1tOVVy8S loyhpWZZB/yE4qNzH58AJ1mF5t2FW05x1xKveOXDSVv59uZa509nFkf8NzgneCdPP/cy+s lR22tU3nSal8zJKPJpqUESdUOZmChS5sTpERRv+mWVZsZ9ZHatml6rmJYTB78ZUpWYcvCl VNuzJL0bDg4IFvhUrISvXuW5QZiyUKd/mfvTTMwwqwrZFsiydaDAaL/codM8tcMsVfStP4 W0C5DoGPv6XZI9RnLmtCwfiuEIuJGUXroYcMt2BzNmaTKAmG2sYfXNMYfEXkZQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 2 May 2024 02:41:45 +0200 Message-ID: <20240502004150.3627661-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240502004150.3627661-1-michael@niedermayer.cc> References: <20240502004150.3627661-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/7] avcodec/av1dec: initialize ret in av1_receive_frame_internal() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: bJ+WIts2/NJD Fixes: CID1596605 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/av1dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 4f9222cca27..93ab04eb378 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1262,7 +1262,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) { AV1DecContext *s = avctx->priv_data; AV1RawTileGroup *raw_tile_group = NULL; - int i = 0, ret; + int i = 0, ret = 0; for (i = s->nb_unit; i < s->current_obu.nb_units; i++) { CodedBitstreamUnit *unit = &s->current_obu.units[i]; From patchwork Thu May 2 00:41:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48462 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f91:b0:1af:7bf4:b644 with SMTP id mm17csp80259pzb; Wed, 1 May 2024 17:42:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWuHB2eQV1kKMQmqUbdz/hMZUPmS7p2vbm8Irf1YFkXq05OIoK/kvJnmhP10OY5zRAzuygrcsNSieNraJUvzyDf5q/+uDyJnSAQsg== X-Google-Smtp-Source: AGHT+IFmWClYtJ6QpSMrRM8CZ1mwfLd9osKMW+cbzolsmhq2XGiWfmz60Lexngx1jD5mn97Exo89 X-Received: by 2002:a05:6402:381b:b0:572:4fbe:d3f6 with SMTP id es27-20020a056402381b00b005724fbed3f6mr2824791edb.2.1714610551151; Wed, 01 May 2024 17:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714610551; cv=none; d=google.com; s=arc-20160816; b=UUaMOtoJN2bjlGVDtWEia4uCT0K49ceYNzbMKs31GliA6JTS+KpFZH255xvvsB2YQs U/PxYConpRDuNGCyewovwC6mgBOz/ydcJUpkJYoSZCt3jsZ0lrE4N4rOrSQk1L7IQbgz d5MKnIZgzhKYLCQ//5iJ3ApD7aHkZutcK717fWpfFz1/5NfYF3z8Xvg6eYLEGESQZdg2 oBYAQ5ZCun1nBsk59k0L3B/Kv+4SYbUPYm4EKcHfGve7qqH/gbX2Kvi0cOF/qcM9TdM/ IHxOwCzi9ZepeqTOqMvzXiB2I4uWXVYox2rvLRcmiYylFwwuuzox0ngMljJMOljzW4F8 18mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=4E3xCjiLRzKum3kR98fpXGpc2ArSsS6uCUa2a/Qg7bw=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=keoqJaoYKuWlkRVeVMcPDPPt3h7Z+GU93w40XyZRZH9vy0lFe9dYD9In97iSaENofe kGAibpfJfj+tnhTlQd53Qfd9i10t5gMgFzGBorGcIuKw6R7df+mTztC9nHiE3Zk/BsqS RKVckwOsLYvgXrnAYK9YqgQCxhT1C1rjDUuK1k9CFLJXSsgEJ/qHzw9gno7Dtv84hRXY m58oktSUc412KZBJKeGJmXUh0/wQiWE3cGfhaEZ1yaPa8yvl0MPfnKDrhXlCEAjNNivp wbt67oWYfUJwVDXJhhUyCofokksPwh8qarvzHXV/xgH+cytqlli3oJWM9JWLgqYk7vMa Y5sQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=da0S1w6I; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m16-20020a509310000000b005705b381c71si17514933eda.395.2024.05.01.17.42.26; Wed, 01 May 2024 17:42:31 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=da0S1w6I; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1ED0F68D771; Thu, 2 May 2024 03:42:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 86DDD68D766 for ; Thu, 2 May 2024 03:41:54 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BFC8620004 for ; Thu, 2 May 2024 00:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714610513; 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=wuhnhzH/5slE7A/rq0gS//Fz/xXoszJuF/wYdxhSfcs=; b=da0S1w6IaqT6c1v+Xo+1xJib6K8Gc/eIo5wmHDlZu6sYzHLE3i4w6sIbgBLSXscZAEUV8m 2g+XKt2+TeQQnmtZb2+8HZA1Y22Ok+qGg53o9lmQ9Q8vteAmz4Tc2EXXizjoF+FdJAAqVX eByESraiBPGPEesGH4Gtog6eRlZvdoWPTP1g5xz8Rq6rWcat6Kz5SsOkHNRC6S4RbTMVtv MoKbjeTNPD/hm1lnejOStOvCC5miBkzU9p0hLiMN24vwYUv/nbH6PqUujgqvtYo56QRGqp 8kaNvjoEvTojDjm/0Bv97VZG5TE/BYDISGnJCY85EY9bJL7TaLv0zs+d8Qbn2w== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 2 May 2024 02:41:46 +0200 Message-ID: <20240502004150.3627661-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240502004150.3627661-1-michael@niedermayer.cc> References: <20240502004150.3627661-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/7] avcodec/avfft: Remove dead code 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 6DPXeSozo1+e Fixes: CID1543204 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/avfft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c index f6787937f67..0f43f30b776 100644 --- a/libavcodec/avfft.c +++ b/libavcodec/avfft.c @@ -158,7 +158,7 @@ RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) return NULL; } - s->stride = (trans == DFT_C2R) ? sizeof(AVComplexFloat) : sizeof(float); + s->stride = sizeof(float); s->len = 1 << nbits; s->inv = trans == IDFT_C2R; From patchwork Thu May 2 00:41:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48463 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f91:b0:1af:7bf4:b644 with SMTP id mm17csp80304pzb; Wed, 1 May 2024 17:42:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVPyz+wL8QGFH6f8K7txTtoZM0cLWiQXcl3JoepDkvL6c5lJicHTmYpqSfRpPiyF3AmMaPfOuvSbb+gSJrmBGJ+4dOAFfMcGA0P8Q== X-Google-Smtp-Source: AGHT+IEaUdD3lmbO8EkEcWvcdyoHp0Fgm2w1jPBV6r8MC3vW2EGG09qRuYdFjPjpg/Oc52hRzlbW X-Received: by 2002:a05:6512:3ca7:b0:51a:cafd:3872 with SMTP id h39-20020a0565123ca700b0051acafd3872mr3058302lfv.3.1714610556192; Wed, 01 May 2024 17:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714610556; cv=none; d=google.com; s=arc-20160816; b=S9J+H7mtmXkCa9uIfupKZS6hZe5XOWKEzwClZaiSnBQg0KG7uf7TYUrJAb+a2CU2s8 lJ+fplyktsBLTcblcxvNVFdiz1KGUpylcQjTTEoJ8xjzl4mN4+wE1QYb26ZUhJL/pY+l 9w2i3EOJyaIVtsfC14XjVO+ujQKno9cDPS1qTNEKPX/aoIgnnPyMZtlX0Sv74Dn+pyis kbRoIOPlJ/+E5/L5enDuJZsP0v7yhzSLINjuU8bYGpXYG0uTNG0d5QhP/XNCk2Ek0grM CZGNG83AWIzaLOgb+bK4sxFak3fnOB9B9QH+mdUNJY/gjpeuPvLvBJMERlkrwXe9BY9f ttcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=wuqRMtL2phgFczm4GVd4ddZKEKL4ZwA6FBl/dYZHq6w=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=ySej973VlDgKOdmaCAd0cAjkKnT+29GRJOv5ArsPTojRfonA+di4axRVmS6FbSUVSx hYJ2nx1Jg4O/1xeGHLCWdaW9P01pp+n/UhWppBbXjjz/VYlQ1K505m67GqXCgArPdWEs 8pYRDEeLzVOGgTIdqSJtvNRn8CQ/JutWBf5p3+xuIWjDuq+4VTJ+FVIKe9KoE//J1wrw Pju8uv8ttHpRn9uJEPgL9h70bKpRXTm0N9xx3UuIeHB/tMAYCNRmD7H96533q70IDFAT rcIbzDebH1l5I0+Cj+jPchBkkVXh/TASa6pJ1/pNN4kzVATXQDjGaUGAFpaA3GsGf2RM JkfQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=Xj1awidL; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n18-20020aa7d052000000b00572a7713ee7si1552191edo.686.2024.05.01.17.42.35; Wed, 01 May 2024 17:42:36 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=Xj1awidL; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7184668D77A; Thu, 2 May 2024 03:42:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8278B68D766 for ; Thu, 2 May 2024 03:41:55 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B7D53240004 for ; Thu, 2 May 2024 00:41:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714610514; 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=28wyICmnpN1yKKTwvewxKbmX/bNN4sHE0Ulkolf6G7I=; b=Xj1awidLEBr3a5c7GC9TnarCT07odf2zuIwFR9QxncVOXkUYE3VAUt1UHaEP7fIb1Ypc6t rX7oGh/AVcrnqlzijXI+NRdx1HmC7yoX1or87kNRQ7TZaUSSGfB51sXcHrAx4ZvZwsACXz /dbl83drJ85+K2PZ0roXyoMv7elLftFMnaBUU0Ovxd3V1YoFqPNT46ljcl8oRaisOv5vNy K/s1469Fdj2H9apPwf0gExvMU0exZWCEPHaQsdyqdEB0/1jadOF3o0tJIeJ5cGZEEN5e9W rAT/7KMsPvRY/IxI93pBGFtk4QNnpQ18EbAMCqkiphm9Kycxqglg4rJH068NUw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 2 May 2024 02:41:47 +0200 Message-ID: <20240502004150.3627661-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240502004150.3627661-1-michael@niedermayer.cc> References: <20240502004150.3627661-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/7] avcodec/avs2_parser: Assert init_get_bits8() success with const size 15 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: pL1UJXXiDMrQ Fixes: CID1506708 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/avs2_parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c index 200134f91db..8d4bc3cee0d 100644 --- a/libavcodec/avs2_parser.c +++ b/libavcodec/avs2_parser.c @@ -72,13 +72,15 @@ static void parse_avs2_seq_header(AVCodecParserContext *s, const uint8_t *buf, unsigned aspect_ratio; unsigned frame_rate_code; int low_delay; + int ret; // update buf_size_min if parse more deeper const int buf_size_min = 15; if (buf_size < buf_size_min) return; - init_get_bits8(&gb, buf, buf_size_min); + ret = init_get_bits8(&gb, buf, buf_size_min); + av_assert2(ret >= 0); s->key_frame = 1; s->pict_type = AV_PICTURE_TYPE_I; From patchwork Thu May 2 00:41:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48464 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f91:b0:1af:7bf4:b644 with SMTP id mm17csp80365pzb; Wed, 1 May 2024 17:42:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUYtSBs6FkS1LZB/Hu5ZGo6keWUUMewL6iUvtuedAwpa5YHYncLq+MqDdb3AR5iVrR8gjZZTGgF2BPzl8vo2/ekRuwVDI/sDrXlAw== X-Google-Smtp-Source: AGHT+IE0vf87AniO3Qw6m/sy0k7Mhspoq2PmO3AJ/Qn3Nx1y9YDJT9f81tgBrjjX42c5Y+hqsFor X-Received: by 2002:a05:600c:474d:b0:41a:bc88:b84 with SMTP id w13-20020a05600c474d00b0041abc880b84mr2675737wmo.1.1714610566591; Wed, 01 May 2024 17:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714610566; cv=none; d=google.com; s=arc-20160816; b=onNmzjm73mkR2XXPV5Zkbp1DC57OtGn4dxalNfFWlj2iA9p0SdNmWOnCF0lBVHC8ZR K+vorEqMwPIkzo4aXOIfuQ31tmiQ57nhg8UEhykjPPBvebGyQ30UsqnzlclWArrbRqxD USJMqRxxtrI8el+wiGAaqtF+NFmU4JHWnXCGnzIVzRlNZwS8XTU0WbhPdaVPYQHy45PF J+lFB4HcCGD+ngGj6aJNe5m6LTYC3kXA08wQpuszZ5K+HHrW+xLMGViwrwDvyaHcuYsv hxw4jx1zaY9gCGCqap8opMdwPvmloLEvuh44vTCHSFghHAxM2wWFSZfPIXTClh9bgego XQTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=gHgqAO0CgGYTUL81rQbdnAr0IUR6T9M6GVTOLY9FUYE=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=VSDcbIJro2wU+w4Ar2yf0NVVGscbA8ohQJrtSLcHtZQYODiKhusA1rZWkvUQUMiYAK 7aHUJoDm5q1sZJfL69C+Q7pPjA79DMN9BmtK03jsXQSgfSljNCkaFX590zhQen2I9uQR xt861ONI7S0X8veZrtj0/SBTvpAxJBRxIyEtm5/qiquTGQ8myZb3ERu57Wlq/+pW/bOt uOnt5f7us1LtP4BHAIXsol5dWJOT+rzz9WtYcPIIBzld5PR71F7zYMukBXSpGjghNEWY bKmg5MnswWJItYo1nF35sJ4PT/tnk+dYDqzY7M22H1K4/KQfLkG1LIsEWSxZ/AZ+a5nO rVNA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=p0UkiWcW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y5-20020a056402134500b00572be1bb6f4si151580edw.573.2024.05.01.17.42.45; Wed, 01 May 2024 17:42:46 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=p0UkiWcW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 83F3368D77E; Thu, 2 May 2024 03:42:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CDF2D68D771 for ; Thu, 2 May 2024 03:41:56 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 13AD840003 for ; Thu, 2 May 2024 00:41:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714610516; 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=2HBlkV3twx6zMIJzrcGXYulmt3659BriNT+tIDYe5dw=; b=p0UkiWcWSwFck7FvTQuBNMyMdk/iLhpUXYSsdvkcP+83hyEybzxD9IevBkMmiKx/XfTfm+ danF74xZIbcWSle5Prd9hR4Y8QaUMCJixPvFfBeZQrkDzYQzi+j8ynt3S9HuXOvTlK+7HK WatSzGrY18Upod4tGF+Ukj+7d1emAsMYf26ebZKcxzRnLMcZ1JuWOmcpZ7UYW857b2mCxM J+X6RyFPyA/ejW3pYWpdfGKHM2bld5pEHWIgvyZXPeTy7Pj/APuhKihgY5CKYR14R4ng1m 6hhZ+XsFiQZFiuSglRdAU/N6x5ohaWAXoArNeznO1JcnlHh8n11qvpuyDMchYw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 2 May 2024 02:41:48 +0200 Message-ID: <20240502004150.3627661-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240502004150.3627661-1-michael@niedermayer.cc> References: <20240502004150.3627661-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/7] avcodec/avs3_parser: Check the return value of init_get_bits8() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: FVEIQt64PGZ+ Fixes: CID1492867 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/avs3_parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c index a819b5783d6..0f9076befe1 100644 --- a/libavcodec/avs3_parser.c +++ b/libavcodec/avs3_parser.c @@ -73,7 +73,9 @@ static void parse_avs3_nal_units(AVCodecParserContext *s, const uint8_t *buf, GetBitContext gb; int profile, ratecode, low_delay; - init_get_bits8(&gb, buf + 4, buf_size - 4); + int ret = init_get_bits8(&gb, buf + 4, buf_size - 4); + if (ret < 0) + return; s->key_frame = 1; s->pict_type = AV_PICTURE_TYPE_I; From patchwork Thu May 2 00:41:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48465 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f91:b0:1af:7bf4:b644 with SMTP id mm17csp80420pzb; Wed, 1 May 2024 17:42:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWudxGV+O0ok6c/MOuhysnTK0jDoPhnlWjG1XrF3FrIsDIq+/3ZoiUst9rYnf9ZomDThlsdBlfXXcDkCLPjkV9/6cmoxuXnGKuxDg== X-Google-Smtp-Source: AGHT+IGht0rofChh++HxE/b/yMkbS5dMUultnqzMXi5aVJm47al4UDNPIclC0+BneX2NvxlV95tN X-Received: by 2002:a50:cdd3:0:b0:572:78e4:c6bd with SMTP id h19-20020a50cdd3000000b0057278e4c6bdmr2240689edj.27.1714610574959; Wed, 01 May 2024 17:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714610574; cv=none; d=google.com; s=arc-20160816; b=HdxahNj4RWDuE+p2Qg9u458/Gh4KXBandLzqr2ypTuclnIw+8WcWUxlQu5nI0lVIcx uv8AjizvpvxiHvOfZb3/nkKwFxtXPp5bF0+G5/0lPGSr/IWUZ5Qowk5oOznMh7l4rFjW dCDlMFUGJmgl35Y2lAAis+Bm04biL0bo+/I5PNa94OP4kitcCY4Q6FfcQmJLOprXeDmn wW8NqJOsgLT8qrHTamyQ80exyoPcR7vVlkrQRBBKoBn/qAVSG86cyiBKwvdREAOeg1kE lvz/MHEVd1AbvvcMEw1W/Q31PPu7K+sQd0rAKjMYULUYXmIYYFQsj3UOZ7HcxQZ7DtaA qb6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=kUC/EatSoWhHsvIYMluZ86yhLKoSZnjcLPswPsbbTZg=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=R1QzYcxIiK+VoDXAEkFvL2XCytECl+hwKzIoQl7ETKFhOXc84XxtnIQ5hdYjLkIm+R XGZKmCVQMrJoVuJ7V5GVvb4AKnsPYLEAauHFufCg1dEW84btChrqFpEr2hAWfu8Dgf/y 8L1sfgJU/nGdE9VcBrXvlBPv3w6FIZrHQTn2ilpuH+3jdj3vd5Y2evEeuPl2/D3ay3bw lp9l1c6KLezkQKmHzcgsjnuxfBrSa9XRz4u6Y9NcZEh84Y1fEEWQkarPZPKjdRdVF+MX RS54b4xFVqRESHeRKeqiPwsFPYyMRVeI5UE33QvlmeiuAWQ84Yt/B/WE8AtF6g3t0kwD drEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=FsjvDZGz; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d14-20020a056402516e00b0056e0ac85636si1620492ede.195.2024.05.01.17.42.54; Wed, 01 May 2024 17:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=FsjvDZGz; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BB45468D773; Thu, 2 May 2024 03:42:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5E98F68D76D for ; Thu, 2 May 2024 03:41:57 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BD23A20005 for ; Thu, 2 May 2024 00:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714610516; 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=lpKtQn9SOerlB4yXhHocj1TBXQ3fZQd2zE9Oxe/p3sY=; b=FsjvDZGza1YsuveC50y2joYXZaCvDoRBXsBz2jhysHKI6NqeYfhFwVZ6jJkbXytszT3N9g 2V9Pkj3PbzK025Zc+H5bHgNjuINlL42yLufOrJalWJjjbYTPwYgL5ruxVsHaLR6KnuUokF kG/x26WQwtuWT5yspy/NGeN/xPOHE5yO/tP8YcbUzJ+yMa9tVOHJU39FIQWs3mfbEgXTHG ppMWWi1s2RVwWZkKi/SaITD4nVjuzsGYzr88n1zsvUapRNHs3RwhVVy7aUGaNVKAEEHdPc Pqh+uz357LrEYEtKYa6+iW2TKkSTAIO5XmhFfbqPCQZCsGW0zdpAm/TUnk+4cA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 2 May 2024 02:41:49 +0200 Message-ID: <20240502004150.3627661-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240502004150.3627661-1-michael@niedermayer.cc> References: <20240502004150.3627661-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 6/7] avcodec/cbs_av1: Avoid shift overflow 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: rhAylE9ud/ll Fixes: CID1465488 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/cbs_av1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 1d9ac5ab449..fb829960220 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -301,7 +301,7 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb return AVERROR(ENOSPC); if (len > 0) - put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + put_bits(pbc, len, (1U << len) - 1 - (value != range_max)); CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); From patchwork Thu May 2 00:41:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48466 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f91:b0:1af:7bf4:b644 with SMTP id mm17csp80490pzb; Wed, 1 May 2024 17:43:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVhiaqpwJu9/KKcq5CeQwVB/7v2o5a46ATDm/E6jV1CWwCg2PJcSYyN1oUikfB0psEnY09R9SsrJQvMjPQXTJzhsyj8WlV+XUgQA== X-Google-Smtp-Source: AGHT+IGhTU446F/TJjj1PLNakhrOsE5SUr6V1FHH5K351NWXmxTSEGH79XUXoHr26J2v9NVJx+Q+ X-Received: by 2002:a19:2d02:0:b0:51d:d630:364b with SMTP id k2-20020a192d02000000b0051dd630364bmr2292463lfj.10.1714610588153; Wed, 01 May 2024 17:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714610588; cv=none; d=google.com; s=arc-20160816; b=p9Drr3cE+WxenZPzYiPDLpRUr7k5ucWtiPIVbRlTHGXoXgQpWVMnaNwZf5QrBx2RBT 5rcVyYJ5ozSiWPyVdSgVK9CTXVOqPGT/vKTcl2ZY4SvO++BcDgTYiEvf7iQFRP7xchXm d2w41M4tkkODlAAiyPX5kbKzbjUiB3DKO9hQ0VBugdAUAz+JBj1mJYKBfBKuPVZnxrks T0GDDtXvKi2vBNzsN5w9iGJQv9gvHPuaZiwCoM7kNfmCOqi3JJn49WJCLgVp18CcQpzH wGxekMzgjlCziMR2Z/khP63fSX2No1tykTbaS6n2xzQKywrQgOtDauUKMjmevficPyza fhLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=3sC1EO/1kwXfwawS2Hby3NtSOWG3+RkOvETs1hTeLus=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=bLwVsOZ8KKD3+e6Dvy4uDAbUZ25sdD/94wLnBbgFxebaHawds3rB1pGL0sLg65uIcJ 4I20L6wsRN3bg7HvrCQO8W2q7lDtTGUGRmHA++ubrD2TyI/YMfxqgRQ/J6IDcRUVDvBW wabW68rKLMCo9uoSwXM5MmimV8xyBEyG8ILJo6h4EZ0rDSTTRnPUs2p8sjQ7ZZ4HXy8g Ri0SOuMhyfaz3KkAX4HpWjH8XjWK5r3SORB7Sfin4u4brrBZ4UW9N80hn03d5Axw3OH8 bd5yB2YZ8od/NaY3fGobpGUm43zvzYg9sLnVkEv52dFerDtk4lL5rvk58epUzQuCOb9l e6iw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=d5SYZ50h; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n8-20020a195508000000b0051f2e06064asi15778lfe.554.2024.05.01.17.43.05; Wed, 01 May 2024 17:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=d5SYZ50h; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0BE3F68D788; Thu, 2 May 2024 03:42:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B6DEE68D76D for ; Thu, 2 May 2024 03:41:58 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EF71A60002 for ; Thu, 2 May 2024 00:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714610518; 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=o8zSVVxNfOT9g4WBPDJOjrlknef83xxP+rbyfLVSMmU=; b=d5SYZ50hg04Ayb8khx2UNcBx36z/HORrPItvZmt/KbMrvAgwRQNGHCxClRA4akgfHZR2mb 24QfNsXYFiPydgZttjTuD6xpv6ldrmygU3rjPmhKWfTLOWxnmczpfnqeZSJIPNm45Tn1UU VUMRxQCJ53IP/dxH0tnrPq6lqj8CCBQ7rhb8MU305RCS0o2H5Gc3b4xzCCT045LMKSkwS8 lu/dwHwBcVbHnmK47SpWAb3wAPVY3Jg88o+7JovlV0KcUES70PNvz33z6QU6DsO4weIq5B 4a+jrt6BF+Ie63wG9E74pw61q3ExK6RhNlhPejat0taCIu5Q6hhIG0GGfZR2pw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 2 May 2024 02:41:50 +0200 Message-ID: <20240502004150.3627661-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240502004150.3627661-1-michael@niedermayer.cc> References: <20240502004150.3627661-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 7/7] avcodec/cbs_jpeg: Try to move the read entity to one side in a test 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: w4n3kuDuEZV4 Fixes: CID1439654 Untrusted pointer read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/cbs_jpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cbs_jpeg.c b/libavcodec/cbs_jpeg.c index b1b58dcd65e..406147c082c 100644 --- a/libavcodec/cbs_jpeg.c +++ b/libavcodec/cbs_jpeg.c @@ -146,13 +146,13 @@ static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx, } } else { i = start; - if (i + 2 > frag->data_size) { + if (i > frag->data_size - 2) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid JPEG image: " "truncated at %02x marker.\n", marker); return AVERROR_INVALIDDATA; } length = AV_RB16(frag->data + i); - if (i + length > frag->data_size) { + if (length > frag->data_size - i) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid JPEG image: " "truncated at %02x marker segment.\n", marker); return AVERROR_INVALIDDATA;