From patchwork Sun May 19 02:49:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48997 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719382pzb; Sat, 18 May 2024 19:49:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXbUn4zlFaWYvSKehaQWy1/IwehufxqotKghsWX22SPjENCbRn7seLvCstf9TJndKdpYCCWO41HD5Ck4KJhhuPgtMl2Gkno38yCDg== X-Google-Smtp-Source: AGHT+IHWn3/DktB/fc6eKhtTxT9dVHiNbfnm2GvBBYrefjV2+8KUBLTKPQkfKNrpkt03MzNkuTxU X-Received: by 2002:a19:385c:0:b0:51f:2ae3:57b4 with SMTP id 2adb3069b0e04-5220fc7dd16mr14940253e87.27.1716086969008; Sat, 18 May 2024 19:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716086968; cv=none; d=google.com; s=arc-20160816; b=io0vOpZxx369FujjBYLJpWwbdpCD0Z33W7P07h1fP9jvDN1RcIcwMPuCp/7Q8z4B5i pV7n+Pox3wIFv6Gh5azgM8tlQ//HxduVFda02PBjJ6Isszp3WhHhB0ASO7WZMBbt71uM 4QA+/3k+l2HvomXfb+8jEiO2U/IqFHQBDKNXOq7w9R60F2+i+9EUJhuQ/6WPt/F/hzOt M3fr9gqnl06D3ClewqXAsYZVqDAxbtex+ThqG2tu9ZGwilpPDqc9W9Nvo3mfL5f3vgk+ unybj3JTcE5Bul9S9hWJh31HuqYsYdMp8PVgRkHwSVNq7+jDQ2WeXqS7MRlyUe+v8KpN TSaQ== 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=99/6LaJ57kY8dMGE08HbacgLWYqMwTnaGWTg4jsCXsg=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=rgg5k+61ELPaywyH6PjwHvYJ+FrKKjx2wL8I/5CwMDlZJXxO1Ocn6EWEFjQ5fVY/sn SquXbtKlNWN/9o7UIZqhH+nTT3378WYnbXUbX2N82Et+a+6PV4AwW4IyOL0uFkHhRB8D iwMFM2Mz9nx0GgEyBMN1XM9PZthg8NUyrG51FCH8NDhhMeK2tKMYO2427im6B3tsJfTN iDsTXJPsGmoiWPdLzOWqAKYBNSLvo3q2lyU/ew0AiOfrfK07RK/GErh95nXhYzhQoWPM 6boEMPEDNyYN3VZvnbTSnblVUS1LucYzs0r0fmfzs2nI4kQ0mnnhwVKY0wHEW8TUpgn/ IzQQ==; 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=MMDBYGcc; 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 a640c23a62f3a-a5a1797a3a2si1144456166b.212.2024.05.18.19.49.28; Sat, 18 May 2024 19:49:28 -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=MMDBYGcc; 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 A078468D150; Sun, 19 May 2024 05:49:23 +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 9B06068C4C8 for ; Sun, 19 May 2024 05:49:17 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id F364A240003 for ; Sun, 19 May 2024 02:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086957; 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=ZWVb/tFEUpGMnFjC/hagQC5r7iTmiItW3uJGyn82kPE=; b=MMDBYGccD7yaMpFMZrTxpvEwDYeW6Jri95uVJWnXJF8KtPQCOuZGMdZ4WVD+S5ZoAPUDNF ix5fy2M+AoTueiynx31PAtoYNuhvMx+5i4MUowdqwddek5lbmuOFADttf4a1jAuXMw1Rcj hfiMa3v8cuBXvZbSxRj+fc8vu3hkOtU9CTMcpSlry6kB4Q//0rzc3JqzlerBMcCnpA9teN XAzR5Z1+G2HqIr6QZPjuEKTyi758m92skbu7K9NAKsI9w+zbPUeqSCh9bEiGZNxo9QWDqa 2IDA9WYBh7CZpsfYajr9di/TwLhtOkRcbPRMCM3mtXvU/5GrcgTPWKv1jc6cyw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:07 +0200 Message-ID: <20240519024915.1944150-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure 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: eEe64fhKFBko Fixes: CID1516090 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vqcdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c index 5c6cab3c1ab..bb69844327d 100644 --- a/libavcodec/vqcdec.c +++ b/libavcodec/vqcdec.c @@ -147,10 +147,13 @@ static int decode_vectors(VqcContext * s, const uint8_t * buf, int size, int wid GetBitContext gb; uint8_t * vectors = s->vectors; uint8_t * vectors_end = s->vectors + (width * height * 3) / 2; + int ret; memset(vectors, 0, 3 * width * height / 2); - init_get_bits8(&gb, buf, size); + ret = init_get_bits8(&gb, buf, size); + if (ret < 0) + return ret; for (int i = 0; i < 3 * width * height / 2 / 32; i++) { uint8_t * dst = vectors; From patchwork Sun May 19 02:49:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48998 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719436pzb; Sat, 18 May 2024 19:49:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVwE8FXLJojQHBC4tF3Ly3IDXdafixyuRBz41MMmwN5Khhl1GCLau+4HCm060DqVqmagEU7RhLvfzapLh5e3mTipzr630XZ8o2/Lg== X-Google-Smtp-Source: AGHT+IEaGMQGIAWqweTy6cKxwtsgsyHY6JUGnnrutMj9UMGFoRAnpB/fOqKCmZNMQmXha9iuynSC X-Received: by 2002:a17:907:7f08:b0:a5a:743b:20d2 with SMTP id a640c23a62f3a-a5a743b2175mr1458096766b.38.1716086980325; Sat, 18 May 2024 19:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716086980; cv=none; d=google.com; s=arc-20160816; b=UzvcpvyyhGsnofkeC9tlW3Nvqyxxa4klRKK0CM2eKJNV4SiUo+4ROebn9CXVi8ZukB YqP5b5OBaBuK0lZdJLiZtjPYUD/W1hlCGLsHWjQRg8HaOHyH6B1AI71fQq+j85rKzaSX pOTIkyfS/9H2KD4b5t19S9JmkMZNN1yN80s0sYNUVUEISi36ufpfe6n99ehm07JGwX3W XNEPxxm6rBpYt0y8Tf46o3fpUaBBsUQjwlSVZoKO3nogjJAxHamWHVLiPsKNK/4FvNNu 02Ond2oqeeMDHhjFQI1JK0WzUHg6n94jKI4xzQJYPtSOCm+sWCT21pJHcNHP8XLmjcLa /oZQ== 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=2E6DYS8/sZLUaeAlf7HzH5Y4ryrvqnGsPHq192+vaM4=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=kz8c5SIWGHcgIgW50dGG0NVcuIjzcDdzG3ml5UaeM6w4s4hrAQflnrP9CBy5IaivPq 3p/Ld+/Yew4Thmu0foYYbrF14S8V1DCErI4Cspj6e5IhQEEzIbdavmd+VrW8A790vXv/ Tn8/QwtnFkHoEBGbIzZWwIB3f2Oe5g6FZC1eOfCmUAatdsf2/iqbiBlebrASAiKIfGRn 5EC+RsEwI7LFKQpEXX9ZI3c952ItBWJicUtFFtvASPF3dA5Jvnq7qckJn4jCa+u0a3gv im7UkU5fsL/L0eWPnulgVHMm7YAqNzOn3Dn8N/FqlOyBmbl+E+ibtmAXwx1FWU/reJ9K +Jbw==; 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=EvkClkB5; 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 a640c23a62f3a-a5a17bb1aedsi1181325566b.552.2024.05.18.19.49.39; Sat, 18 May 2024 19:49:40 -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=EvkClkB5; 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 E5AFE68D212; Sun, 19 May 2024 05:49:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D2BE68D16C for ; Sun, 19 May 2024 05:49:19 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2FC041BF205 for ; Sun, 19 May 2024 02:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086958; 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=Dew8ZjhtHCoc8+FzxjJBYtL9mUq63eoACGEc++1XYZs=; b=EvkClkB540jOvBNmbLQpSVi8omrwIg5XJJUxj9Mmt6JW0qEZyfrMNRW/UOms9dVEEFqfzy XsTjE6nzRVinjIDROnAu4F3jBmUFeZUE2gnm0Fs5l5wQTKvMORDIV4yzR2IL7nD2sLF+JZ ckjxWe3BvimJo90MzuqTpADb+wtV/VJjTwOLB14Shn5FatxkR/utB+qaxQgnA9Q9kaiLTL 43IKUeqW+T8zzGVBCbMTFSmBmu/LpEjH4xSyS+bCoaHjqRcSXsPGnBEWL0xh3ssTYg9pf4 kuHkZRqkO4rHciuk+B+54FZTolGqXsWkEmFU4qCbn30MBQAO9HPHG32kor2Uig== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:08 +0200 Message-ID: <20240519024915.1944150-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240519024915.1944150-1-michael@niedermayer.cc> References: <20240519024915.1944150-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode() 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: DwtylmkK2UO/ This simplification assumes that the code is correct Fixes: CID1560036 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vvc/ctu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c index 53f92ca10f7..7495ced0d5a 100644 --- a/libavcodec/vvc/ctu.c +++ b/libavcodec/vvc/ctu.c @@ -1080,12 +1080,10 @@ static PredMode pred_mode_decode(VVCLocalContext *lc, } if (pred_mode_ibc_flag) pred_mode = MODE_IBC; + return pred_mode; } else { - pred_mode_flag = is_4x4 || mode_type == MODE_TYPE_INTRA || - mode_type != MODE_TYPE_INTER || IS_I(rsh); - pred_mode = pred_mode_flag ? MODE_INTRA : MODE_INTER; + return MODE_INTRA; } - return pred_mode; } static void sbt_info(VVCLocalContext *lc, const VVCSPS *sps) From patchwork Sun May 19 02:49:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48999 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719477pzb; Sat, 18 May 2024 19:49:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWFP2kEWneZHHlf7fI6iW/15mAnYl4iWg+jqgEJJtquoDnN5iE4A+3eipNXaBWrBh9HfzSs9xdO8VeSTxDvXsA/2ov7Ne/PGJ737Q== X-Google-Smtp-Source: AGHT+IGaBrYq53Do7jzay7U1n+T5beQKHt4o14VMHJ8B25+yIwqoZvrHKC0uuJP8RvIc1IPVytAj X-Received: by 2002:a2e:2e03:0:b0:2de:42d0:faf8 with SMTP id 38308e7fff4ca-2e52082c658mr151082471fa.5.1716086990373; Sat, 18 May 2024 19:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716086990; cv=none; d=google.com; s=arc-20160816; b=yBFlbsDVShZkX+uN/qHKCHajbAG7RrJpo1J7zNAL+YSZN63OypYzk05O+auvSucIzP /C+ZGp+Y6seN2lS/qIpiLGTOh+cZHlSG4LoDtfn6RM8mtlKOlhNVw8e2HJ1JmfI2EI3N faCPa0VUGQfLHmCMVKPjdAaUcgaEjy0wPLc1rhmrmENWw7gv6BwdhFRbgsRPVrOb6ayG Ek20ZHpkhKHLO1HyzhjuRfjFSkHXw+yCrHHI/nSTvwp21ZNuyuKAOlyJHP+Xyg5G+mmZ 1KpPJpVOMkAZJS58WqZXKk8yDEWHUw0LVCVLhMJIfjfChJqFDbZqSFY+Vrjgxu3nqUjE 39kA== 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=52aaXphLG7DJOKQkfAF/vELfigOGC5fNuE7BcBp1mwc=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=xaa5rO6K/24Nyd7paNTmR10rNzY8PQpolh0HXPKRx8HyFKM5f1IyKCVSJ77PzU5n6C X3RV9Q9g4W6YskafLRdU1nWoz2NEfcKm/+EQSrX5ePifeVXs9plFrvaOd6N2vMlDl3pP C8GjaPSyHLZMpCjrpkgbgTkf8J5FwbOPSEBKjb19rTLoh2w/8u0EK4Z2aFLHaTJOzfaB nmNrD3/RU5htfBXF5bA0v13uyjdhpJivHe4ZUeWvy8WEFUDNxUsiqP3GoJius2VbuztW 6Lcr54QWhL7QhWAIQLXuzXXom+lyn5g1SUaBUwA71NhpHkQdoQj8/Gpyv5TABRvV/eac KmDQ==; 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="NG8dui/G"; 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 38308e7fff4ca-2e4d0bbc665si64527541fa.74.2024.05.18.19.49.49; Sat, 18 May 2024 19:49:50 -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="NG8dui/G"; 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 2ADC368D24D; Sun, 19 May 2024 05:49:28 +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 1706B68D119 for ; Sun, 19 May 2024 05:49:20 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3FDBCFF802 for ; Sun, 19 May 2024 02:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086959; 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=Pp/82XlyR5ep+ZPezybvL8vAeWk4440zvUzRr6gFNRM=; b=NG8dui/Gp/dZPEVjDyFr18bECVZiuYDMSKejY1sMMZAP331/+SQ6P2YwZN10FlJ2kNag3C Z2S2pRBxpU5JQyH9fuOb+zus+Z9Dxwe3UAM7p8wO9bKiFMaJX15Z75WRWkzOtz7GjY9RjQ PebvgzTTlHpAr43azKo0hJHo0PXWQdGzglgSwY1xhzqBebSGLLDPlRAtpJzDVgKoIWGYCJ d4pCfeQFGjCD+0V1i+k83O5nOobNix3FqnJWoJYxS2hZaz2kdHctaty1hvrcjCl4DRIYQg lLJWjNcxJV+5+aB7PNjHF/WFuRcIGOSuAATekl170Tab891I1e5O7WOYZOr6pA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:09 +0200 Message-ID: <20240519024915.1944150-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240519024915.1944150-1-michael@niedermayer.cc> References: <20240519024915.1944150-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/9] avcodec/vvc/ctu: Simplify pred_mode_plt_flag 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: q5ag9taxw6+S Fixes: CID1560039 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vvc/ctu.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c index 7495ced0d5a..b7089b9a004 100644 --- a/libavcodec/vvc/ctu.c +++ b/libavcodec/vvc/ctu.c @@ -1793,7 +1793,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in const int hs = sps->hshift[CHROMA]; const int vs = sps->vshift[CHROMA]; const int is_128 = cb_width > 64 || cb_height > 64; - int pred_mode_plt_flag = 0; int ret; CodingUnit *cu = add_cu(lc, x0, y0, cb_width, cb_height, cqt_depth, tree_type); @@ -1811,7 +1810,7 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in mode_type != MODE_TYPE_INTER && ((cb_width * cb_height) > (tree_type != DUAL_TREE_CHROMA ? 16 : (16 << hs << vs))) && (mode_type != MODE_TYPE_INTRA || tree_type != DUAL_TREE_CHROMA)) { - pred_mode_plt_flag = ff_vvc_pred_mode_plt_flag(lc); + int pred_mode_plt_flag = ff_vvc_pred_mode_plt_flag(lc); if (pred_mode_plt_flag) { avpriv_report_missing_feature(fc->log_ctx, "Palette"); return AVERROR_PATCHWELCOME; @@ -1823,31 +1822,21 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in } if (cu->pred_mode == MODE_INTRA || cu->pred_mode == MODE_PLT) { if (tree_type == SINGLE_TREE || tree_type == DUAL_TREE_LUMA) { - if (pred_mode_plt_flag) { - avpriv_report_missing_feature(fc->log_ctx, "Palette"); - return AVERROR_PATCHWELCOME; - } else { - intra_luma_pred_modes(lc); - } + intra_luma_pred_modes(lc); ff_vvc_set_intra_mvf(lc, 0); } if ((tree_type == SINGLE_TREE || tree_type == DUAL_TREE_CHROMA) && sps->r->sps_chroma_format_idc) { - if (pred_mode_plt_flag && tree_type == DUAL_TREE_CHROMA) { - avpriv_report_missing_feature(fc->log_ctx, "Palette"); - return AVERROR_PATCHWELCOME; - } else if (!pred_mode_plt_flag) { - if (!cu->act_enabled_flag) - intra_chroma_pred_modes(lc); - } + if (!cu->act_enabled_flag) + intra_chroma_pred_modes(lc); } } else if (tree_type != DUAL_TREE_CHROMA) { /* MODE_INTER or MODE_IBC */ if ((ret = inter_data(lc)) < 0) return ret; } - if (cu->pred_mode != MODE_INTRA && !pred_mode_plt_flag && !lc->cu->pu.general_merge_flag) + if (cu->pred_mode != MODE_INTRA && !lc->cu->pu.general_merge_flag) cu->coded_flag = ff_vvc_cu_coded_flag(lc); else - cu->coded_flag = !(cu->skip_flag || pred_mode_plt_flag); + cu->coded_flag = !(cu->skip_flag); if (cu->coded_flag) { sbt_info(lc, sps); From patchwork Sun May 19 02:49:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49000 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719521pzb; Sat, 18 May 2024 19:49:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8y4749ruD4UJJjJ8yNkYMkelEPmSSu7H+hMGyzp/K9WXeGVV4o5ww379aLQsnhKjm5qBLxCRL9GEzrMqp9Gvh8z/jJ7SScQK4/A== X-Google-Smtp-Source: AGHT+IEBuwsZwxIYjI/LNY+ZN/8pY6sgNDBHOONc6KVZ7pV/KGXXhsbGksRxtVRTIZXgbLP1UqAh X-Received: by 2002:a05:6402:695:b0:572:5796:85fb with SMTP id 4fb4d7f45d1cf-5734d6f57d3mr16214050a12.4.1716086998634; Sat, 18 May 2024 19:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716086998; cv=none; d=google.com; s=arc-20160816; b=P0OgxdxOvJZDZtV4eXgnNf5aoABD+o+WUvsluzsj0wT9RG/4DrGk1HOnsy7l/2M9YG cTIq7AN7f2pekh1D54MUntwZIn5vTeDWnPjFLKWoJBGyNVcTkATIyYCJBWE+i12Rg+Ez yKL4I3fZJR4aTjXi+d8vY3IETqIWHrdIdFUfR9L+gYQYf7Qus8Yp+3CCbobX5UMHvvsG ZQU+Wp2Vi/CZCCostwAu45VV+Zvje7kXfvS1ewf7UuR/jEd30X1ijaIl2oUMkquh7FtE Q7ixJE2jY0aYp5rlmKmNWh+j977ztCYockgSmqLFrzKtAWE5BuCu08AxzbRygv68fh6k gEpg== 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=RbGrFJ2wG7DrW65Wc1FTY2k/YGTp3R+biF62F49bl8g=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=wjdwBQD19vCJkSInMiF6+aJB8YccZnDKN7YjQjC4ToBXzt1NIl9a8zDtKgDc58oil7 6wvsLjkopU8r6PwHqsQyvW4XvHNRcEPQ60oQq4lgyK0ALq0cz1ACSDIZwduiNa/pJ4XA nEov+08OZeh0cP1PhnFtvQKtvlvtHdIpwHa9zHvjPwBeHSSvmefWPPGyK6zyGWS4ox0s A6phdEd3kXdcc15ZAStPWEr63eG2yAYPYpsWapX65IEWbuZTiJDowhVVyekZspvNVTes Q7O3vWmSe17+6ux7ep5+CR2nk9Jawx7ol/izZwxnMJxBPlci9GFOWviVRfHOg+3J6iSl 65rQ==; 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=lMWcBcHT; 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 4fb4d7f45d1cf-5733bec1786si11238136a12.174.2024.05.18.19.49.58; Sat, 18 May 2024 19:49:58 -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=lMWcBcHT; 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 519D068D239; Sun, 19 May 2024 05:49:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 501AD68D16C for ; Sun, 19 May 2024 05:49:21 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A21D61C0002 for ; Sun, 19 May 2024 02:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086960; 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=wpGddyIEO5Ge2VdLgTSWj0MAmZsHj3omPhRmrMaK/3w=; b=lMWcBcHTQr/ZSo9bF1JPlDUnE4Kmgql4NJzhUnx/0v/MpUQbv9+hhj44TsB7MW5DXcJGJ/ 0wps4pFgkWUriZ1C+lPWrAURQd3HHwb1+wF3QPnoigHVhd18pWACMrUTA3+K2cuFaYyM9X 7kko1LA3K0k7mjec9UDWaXoCQgpVvcPrUnnZ2JCU1grL4x7VXo+XYVe/fH6DEgTF4GyOW0 vwaHmhSOHEAYNQ2yg/LxuQBoSG1/nKXmXiKRDsU10f7vDjZ6U//lYQKgQUUJ6C6PvsBbDs ReJIdFHQuNDn/7Nw4Z5h+sV8ULQcnn1MPXVf5O/Io8JmrgjSDvSfb7h2ofhkiA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:10 +0200 Message-ID: <20240519024915.1944150-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240519024915.1944150-1-michael@niedermayer.cc> References: <20240519024915.1944150-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/9] avcodec/vvc/ctu: Remove dead ret check 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: QuvE7iVlTz3I Fixes: CID1560040 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vvc/ctu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c index b7089b9a004..89eb9d338c7 100644 --- a/libavcodec/vvc/ctu.c +++ b/libavcodec/vvc/ctu.c @@ -1854,8 +1854,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in cu->lfnst_idx = lfnst_idx_decode(lc); cu->mts_idx = mts_idx_decode(lc); set_qp_c(lc); - if (ret < 0) - return ret; } else { ret = skipped_transform_tree_unit(lc); if (ret < 0) From patchwork Sun May 19 02:49:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49001 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719561pzb; Sat, 18 May 2024 19:50:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVVgj70fZHzHYfu76VdYq/MvZwqc+FsbE3aThL0lhin3pPfOioeyTcG9ocLi7OXyTsJslULchHbgP5vaBDpIAARH7uUrrBW9KZqyA== X-Google-Smtp-Source: AGHT+IE1JhutYXP9dA/M9i6suCMiMF9aDphuAyUUY4XJkFFmtN79lB6g+0Z88jQRclx64/4pp1Qf X-Received: by 2002:a50:8ac2:0:b0:572:4faf:ed68 with SMTP id 4fb4d7f45d1cf-5734d67b076mr17615661a12.27.1716087008312; Sat, 18 May 2024 19:50:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716087008; cv=none; d=google.com; s=arc-20160816; b=kuIaztXcZwir6GMky9zIhg869kQ7I1+mV9kQAEzfl6z68WE3Ck87nNZiAq5sIpMPwQ 2X1tG+vxVFHxkZKAzV343JkkTvOCfkU/tDLp+n0xgygDeJqZqS8eSzj18bhoKIvLyZV6 9V1UsA8IcFlS27IymkUcSumTencGfazzp5k28SSIDLQvUPMqp7Nfn2hYQvmypw0fCs0u V9swuu6eb51hqu4od1LkP47McXI8TpdYZDSWauiyJ+5DMcQ2r30jKRrxKEulz5MAZdOm /pYZeSFsUbcpOI2+MXs6qdN0UtNU3qQuzskU50eDMMEAgb6+vhm/PJAHLLOV31ImPyUf Y0vg== 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=QkV4yXHcB3tmBZ2BY9I3y94S/5inKey93evIPdzt2bA=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=inxEK1MsufrH4sVI7RAnAa0GFX9UgnbGNr/dkayAY+q0lNvELX29X/Vb2Ni8AHfFzA j0bc/P60fR5of+tA81w5A/51b5ETTwIi2bI9RBgErOrljkZbnI5VY1jeUobA53B0wsu5 +J2GED9jTnbQhiLvPjAywBh1hmGYOsXjTtgdnI9tNBqqCCaE6N/IGGcf8gCjXOTUV2OQ /nuksZ1UF6HK8t8+al1IX8Wbi0MJnVPSYfGJchApaTHsflqEdXf48Iow+bI/zLnxZ7zz ky3PwXqwJ0lj4vMwcWFGWN6hsKQUb/7ufGTxlQrcQywxcqAFI8UlMhXXuqP99o/cuLpm ayWA==; 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=ernnDlFR; 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 4fb4d7f45d1cf-5733c32735asi11797817a12.376.2024.05.18.19.50.07; Sat, 18 May 2024 19:50: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=ernnDlFR; 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 7ADF668D26C; Sun, 19 May 2024 05:49:30 +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 7C6B768CFCE for ; Sun, 19 May 2024 05:49:22 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C80AA20003 for ; Sun, 19 May 2024 02:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086962; 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=pSdRt4D/xl+G7JFLEU+S4tCZ8KFAeyetJLNB0hajr0Y=; b=ernnDlFRJsWuR0BcpPYFhO0LS7OnIlxec1amN++MGAVOM+ENwUnKo/7efOyf7S1Z3Vp5F5 XFVjb/Jn2C1Dbs0Evhd8J7rDHd0P4f4W5lz2jSb83BC2SJtNomXY0r/vtnNqonaxORqv34 T1oQKnemxo+ogitCn12jbfZ+Gup58kDw9tWfbeFv1SOHkh2rjtTQXVLQgvt4DPWSSRKMHW NguWTMH/KKPhTtymvEOUzXxN7OjaYFlk/VXjs2sHNsTDPvb+3R36W331LZvFGtJ7Sgw8B7 5AmAEO1kFTVmaozswaOeIjhkL71pU19eLIHxdm/SopcD8a+ywaJ1dsS3owZOeg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:11 +0200 Message-ID: <20240519024915.1944150-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240519024915.1944150-1-michael@niedermayer.cc> References: <20240519024915.1944150-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/9] avcodec/vvc/dec: Remove constant eos_at_start 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: So7xpyr/NfWl Fixes: CID1560041 'Constant' variable guards dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vvc/dec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index 25cdb39cabb..d262d310125 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -825,7 +825,6 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt) const CodedBitstreamH266Context *h266 = s->cbc->priv_data; CodedBitstreamFragment *frame = &s->current_frame; int ret = 0; - int eos_at_start = 1; s->last_eos = s->eos; s->eos = 0; @@ -841,10 +840,7 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt) const CodedBitstreamUnit *unit = frame->units + i; if (unit->type == VVC_EOB_NUT || unit->type == VVC_EOS_NUT) { - if (eos_at_start) - s->last_eos = 1; - else - s->eos = 1; + s->last_eos = 1; } else { ret = decode_nal_unit(s, fc, nal, unit); if (ret < 0) { From patchwork Sun May 19 02:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49002 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719608pzb; Sat, 18 May 2024 19:50:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW+VvnD9mrWzzJa3Ly+0KQf3GEdAwxCY/fyrEAEEhYdVl7VzqazZIGD6vC8eHxpE4MpVzB5i3uz1/suBcDtRPo3z3T3dbkkBp70bw== X-Google-Smtp-Source: AGHT+IEBUEaBCg4wl8X+PakFd0Wofj4K52+D8Ylgfjb8M1tGpkdz2tdfZY1sgoOlFDRZ0Q3YcDqR X-Received: by 2002:a05:6512:1305:b0:51f:452f:927b with SMTP id 2adb3069b0e04-52210070208mr19975980e87.45.1716087017365; Sat, 18 May 2024 19:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716087017; cv=none; d=google.com; s=arc-20160816; b=XkCQTacv3aJhtJ/x3njpKXDiR3EZa9tX4KGOV8yVyG7wmVr1/nIdTRhsFGxN3NfkaB iZ8b6zGZ4Oa1F6syfFBSIneMYGl359jsgPb2Kv0uJOF0CmEwVtIP5jcpgxUomXZQXwm/ L/FJvakj3BR5ep2DpvJXi4wAbsj5hSkY0Mvhk0WGmb6eqva6Gm2Y3r9LBmbS0udaYFq4 D0tzQlQw6nlRs/zH+J/GnIhRcdTuEXvdrNH1N+X5kDaYn0KavzLbw0RcAoDrnkJJdvGk mzvcQkzSyWEj5ex6Vzuxhq9WZy2VwqLwVO6AVLOvkOQcQ9F4qNOnm6P91aSOct8Lp96T L0Eg== 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=6nTH7XwzidfYzv2MpVb72P+u8sSoJWZZ57f0bE4Qs4k=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=i2jMg8IJ/1hO5cHV6GNKZ24D7xjxTzw0a3ImPH1KuFQAe+jIwN5WYS28cdMLtik14y M+KkpLTAOvBBSwYL8lEDSEQqayB4I7MPVlxh1G6JsoOC7pdiuAXFj38A+xa0iHLWTq98 aOW25JWmYCb4QoctfW1W1mj1fqq4zpAX6e/mATP5qsMIZ2SmxdE1FaiMswLYPnbO2Fd/ LZoHrMEZciFKTXr8paulcG2w6MVKjVoYVNIUyS+sAzFSXwZBCNPglA87Ljp+3PstzvOm PwCdy2sAZNbCJ8MKYtTVwlbXbJ768/pjqH5aIuh5VUveLuFm1U4FCpOJ8+QYvXW0dSUV 3qGA==; 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="L9vv/w/Y"; 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 a640c23a62f3a-a5a17ba2accsi1169467666b.524.2024.05.18.19.50.16; Sat, 18 May 2024 19:50: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="L9vv/w/Y"; 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 96C8C68D22E; Sun, 19 May 2024 05:49:31 +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 D778B68D239 for ; Sun, 19 May 2024 05:49:23 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1E5EE40002 for ; Sun, 19 May 2024 02:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086963; 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=CbpfJ+OCprBfLE3cAcU4A0tXPmGuC8aNJIdXEBcZFRo=; b=L9vv/w/YN8lRHzFP4hj6oDo+NEJfhgaOrDgFCbWHSS0lxJCgrFAIzWMNE9qj3LJpO0Q0ju PVfpvncuvy92I4Da9Q9Xg64GJM4fBtDeIuUXCgoZdotf/oYbAbaeIq1N8SEq9Nr0myEOco 1ueXnTJS03ubMGsybuR8VY78+DWCvkpuNQ7VrzJwiZJozChvSyHovqdVCtyy4pQo8WCm8a JG55bEfedutYWyUpcmsuTlpdm+UoN3rwr6gklQ+RGHPDZPHyX/t6YUhkiH7tUxiyuU+Vud 6IeudURet7UgDYy6SZjs/vXRj3scxm7g9vW6ijOCkEKkUZFFoG7snh+coa9zUQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:12 +0200 Message-ID: <20240519024915.1944150-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240519024915.1944150-1-michael@niedermayer.cc> References: <20240519024915.1944150-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 6/9] avcodec/vvc/dec: Check init_get_bits8() for failure 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: 63JS/F8AREP/ Fixes: CID1560042 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vvc/dec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index d262d310125..f2ede490c8b 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -514,6 +514,7 @@ static int slice_init_entry_points(SliceContext *sc, int nb_eps = sh->r->num_entry_points + 1; int ctu_addr = 0; GetBitContext gb; + int ret; if (sc->nb_eps != nb_eps) { eps_free(sc); @@ -523,7 +524,9 @@ static int slice_init_entry_points(SliceContext *sc, sc->nb_eps = nb_eps; } - init_get_bits8(&gb, slice->data, slice->data_size); + ret = init_get_bits8(&gb, slice->data, slice->data_size); + if (ret < 0) + return ret; for (int i = 0; i < sc->nb_eps; i++) { EntryPoint *ep = sc->eps + i; From patchwork Sun May 19 02:49:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49003 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719627pzb; Sat, 18 May 2024 19:50:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUopimm9rKSmeeJ1qyp0rEbWWM/JzYBgMjR7+IR1Vj8ARAbDF70oB/jywem/BIZIB7Bbd1VU45zFMZWWbzklvcLVkeMdb8Nugmjgw== X-Google-Smtp-Source: AGHT+IES+6zwBzr977jBu3xByk/aSvdpROGbz7sLsmuFsm4U4RyWZQtp1l4UMVtW6a6walxvReMV X-Received: by 2002:a17:906:fe49:b0:a59:cd10:9228 with SMTP id a640c23a62f3a-a5a2d508428mr1936062066b.2.1716087025879; Sat, 18 May 2024 19:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716087025; cv=none; d=google.com; s=arc-20160816; b=w01iGsOqKZ/lBcvlJR+J2oF+SmphCGSYujOaZydXuB7+ugc82CF4BTfBcPLvkVnu7X y1gj/DZ+pIY8nzyg+5xSBqClf8l8rbj+Bjf/AHqeolqUblAa7BZ+ANGyktBhXzVHPnH8 zxwQG1UNPIOfm55J5G7CiActe3Q4wRDmwriXUSecpzqfPpM7cLTUuDM+Jmn1aFNJYDgB bjO4IK8ig5pInuLATkaZBV/nVZb3kOrpN3NHzxjOKnEiQlaC/dUiMiIRQg8bLVNyKdwu HF83dvglWoYIC5lTWn7pBmb4KFbMyPXKU+OPsz5JgtUQGOX2uIzdDr7BDcg53ReZ6Y9i iYAQ== 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=0lyLg7W5sH/TbhT0N+uTdMCLJlEMPmsxW4+WbkxrPt4=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=IWfoUY+S+Ah6IEaSS+x40DbvefdRusGYVW+kcqi/2ZIVANSy2bKyPKTaWMNg553okk 68UUUb5HMA2erx6DFdzo90waTe1YEN3Jsh9oQxWB1/NGqoHKDAU7EqNZAXaGTZUe9oZY NEui7UV2k0/p6tYRpJOUedGu7uR9Od4u5YIFHzkQnVb1+DgzG+SqcCa7wwK6OLE7uiXR ItEmjHOm4JQ6AX2A1EwCBGBm1eacsnz4ERlZXla03GQjeakX89GULom2t7JDQwiPlx17 p9U7NgtkP3db3ZYslxkJ2fYmHJxjA+ez61/p+w14bMkICHANX2IuOf2dlbZGc10gPuVl j7Vw==; 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=K2XZQSlD; 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 a640c23a62f3a-a5a17c2c4d2si1180631366b.1018.2024.05.18.19.50.25; Sat, 18 May 2024 19:50:25 -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=K2XZQSlD; 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 9A19068D28C; Sun, 19 May 2024 05:49:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 857FD68D293 for ; Sun, 19 May 2024 05:49:24 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id CE86A1C0003 for ; Sun, 19 May 2024 02:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086964; 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=TSSFYULLSVsZqBNNtEUsZKhAJaeZr1v/9scAZZhA4OM=; b=K2XZQSlDjY7GUilq6Fh+iA90ipgCxglef83vlThGG8v+xO3VqB9hfI8QKu4lvLf7676x6E 0kYwiU4ZtixrC38lMSOd3Mp0AaNcWMlTol7dvhrRByvSl5T+ni1aT7aFJE5P92oswNt5VW gDJ8aY/IOQ9zX72hwdMNL+Z0Uc4yonpQ3MauVtCli6dti1Ps9Qg5dGSPwmfTI8ML6JPDbg UjUdjGBMdJKdGRzVVykDh4V/A856BdB2E7/5fIjXdSAzWwkra48g8JFO6tDCGW4izO6t6h pYJpUFr+edM7dteif7K08KuB3KAi+bDhSJNA4n3xFeawAJqeBPVcm4IklHxULg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:13 +0200 Message-ID: <20240519024915.1944150-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240519024915.1944150-1-michael@niedermayer.cc> References: <20240519024915.1944150-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 7/9] avcodec/vvc/mvs: Initialize mvf 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: nVOXcseZjRqU This might not be needed for correctness but it could help general reproducability of issues Related to: CID1560037 Uninitialized scalar variable Related to: CID1560044 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vvc/mvs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c index fe7d9234603..521cf96a896 100644 --- a/libavcodec/vvc/mvs.c +++ b/libavcodec/vvc/mvs.c @@ -411,7 +411,7 @@ void ff_vvc_store_sb_mvs(const VVCLocalContext *lc, PredictionUnit *pu) const int sbw = cu->cb_width / mi->num_sb_x; const int sbh = cu->cb_height / mi->num_sb_y; SubblockParams params[2]; - MvField mvf; + MvField mvf = {0}; mvf.pred_flag = mi->pred_flag; mvf.bcw_idx = mi->bcw_idx; @@ -504,7 +504,7 @@ void ff_vvc_store_mvf(const VVCLocalContext *lc, const MvField *mvf) void ff_vvc_store_mv(const VVCLocalContext *lc, const MotionInfo *mi) { const CodingUnit *cu = lc->cu; - MvField mvf; + MvField mvf = {0}; mvf.hpel_if_idx = mi->hpel_if_idx; mvf.bcw_idx = mi->bcw_idx; From patchwork Sun May 19 02:49:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49004 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719671pzb; Sat, 18 May 2024 19:50:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUmm+eHzC1C5WWXZu7UZIwWOuH4D3OnykKMWBBplXqo80dRF/vJ6hUD1NsOhoyMgllQFJ3s9Kbz+3IHqXEa8Q2g6whIZYB0lI4lqA== X-Google-Smtp-Source: AGHT+IEBesgbGCXBv+8lWMBWSYYs4H+xVz9jAU0BiymyBETPBFG0ujvAHQOAuwSrTJS8noD+oXQC X-Received: by 2002:a05:6512:a84:b0:523:b261:3ddf with SMTP id 2adb3069b0e04-523b2613ebdmr7733428e87.32.1716087034511; Sat, 18 May 2024 19:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716087034; cv=none; d=google.com; s=arc-20160816; b=wAC+p4GIdDXtNscxLC49/81JLP2GQqUwgiLlSK8zoBtb7qs+vwXxnqMl+1Xdzp5VL0 FnB0bzz6E9I5B2aje7o6WV5uTVdt5sH5hJN0shW1HWXUvnh6gU4xvBcLyE76MyQ9aSrc cK4MwwH1QyRl5UGgcwozTjbYAvRy3zQNbhJwvafKdEusRwipGft7wz2UeLJK9Ns1Cqqe Rb3f8PZ9SAVt+bGhI0610Gao/9/0NaXe09ouz7qRCEU01QEfz6l8xPgepaSJm77YOo5m 2ZJuvuYt/5WvGIw/EhX83Digk61AA+KWQ7+sVMnyGGcyskhj0bCpYdbPTQ3pNuS9+oUW p29w== 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=cU3gJcWgvmJYbvNGVq87VMhgLOq09a9KhKnZVzHa3K0=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=FyEeLBrPJXpBSF/ZR5T4k3P6UWW3w/GmtRcaKCfglcRbyID7XynV+WdKVlEPnZLahv CLepfXIMJViEhytOhM8t9UPkYhl4ibFRepSN+qCxGJvkhQIWfTR+m2/ZkMBx3hL2dnoW EntOCemlHWhSyBT9HsFa770Lb6/fz2lyObpXVMQk1LQofNsE0LftSBO/kupwVzLLbOd2 nc+XrfmQh0X0Xa0ztvbTjTLgEJcKRvujgBrnX48I962g0UQTBgoZ3slCXO8JaoJxof2y J+C9wm/C/tm+ul9VegVXqmDjw8vblqJFE6Cx/O8y4RhLgJqSw8fYovVtyqCpLW5y5snL I+jg==; 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=kTChXFl2; 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 a640c23a62f3a-a5ce0c56075si389910266b.10.2024.05.18.19.50.34; Sat, 18 May 2024 19:50:34 -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=kTChXFl2; 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 A16DD68D307; Sun, 19 May 2024 05:49:33 +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 CEDC268D2A7 for ; Sun, 19 May 2024 05:49:25 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E52D6C0002 for ; Sun, 19 May 2024 02:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086965; 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=3bm8NjRWaBEHczyfdh82vA0dM1+IlFbl5vC/ZW4LInc=; b=kTChXFl23/2biDK+0ygCz3tS3Nqm485XLrCqKn/DJ3OzD9MW9U1EHjTKPQjO1of/559MUa AlrhVANnIGiVBk+Ahnf99S13TBTxqxenzbaCMjqG/JmY0m+GQ3ti/tbMFihfSnSlPRHnN4 Hiuy3z59YJwby6Eu0hmkXJqVr8aSOtOS4CQ6MdVWA/96OlCR04UW/9/mHM2ogISz2hLV+Q JD65HM0DfKLeAustBIB23BkLO0S9DKlzC+zgSNJM9gyCjGLpuaLQdyegF4roc3UA4ObP/L FoO4clwSn0OKurZ9s7ZUMOkf+x7t1MnBhofjVS8knfJlqwV5EJwj/p0fUC12Sg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:14 +0200 Message-ID: <20240519024915.1944150-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240519024915.1944150-1-michael@niedermayer.cc> References: <20240519024915.1944150-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 8/9] avcodec/wavpack: Remove dead assignments 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: Ckbfq230417S Fixes: CID1442018 Unused value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/wavpack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index d4cf489c0fa..bf9aa0cdcec 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1418,13 +1418,13 @@ static int wavpack_decode_block(AVCodecContext *avctx, AVFrame *frame, int block chmask = bytestream2_get_le32(&gb); break; case 4: - size = bytestream2_get_byte(&gb); + bytestream2_get_byte(&gb); chan |= (bytestream2_get_byte(&gb) & 0xF) << 8; chan += 1; chmask = bytestream2_get_le24(&gb); break; case 5: - size = bytestream2_get_byte(&gb); + bytestream2_get_byte(&gb); chan |= (bytestream2_get_byte(&gb) & 0xF) << 8; chan += 1; chmask = bytestream2_get_le32(&gb); From patchwork Sun May 19 02:49:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49005 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719696pzb; Sat, 18 May 2024 19:50:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUztdQUh6xRl1CBkmhxF6xDu2/map6Mww91wiBXX+FL5IZZDZb2cOCEaD5/4AXXM4eNdnn9wWLg7Asi62nr07MbqBvy3OMez4BkYQ== X-Google-Smtp-Source: AGHT+IHjPBVrkxYzVllQbsRQW+ICvt/jGOthUmBWVQxp3/hfpbgDRlVv56RpU4EbX7OBILSpfnXo X-Received: by 2002:a17:906:c7d8:b0:a5a:8afd:33b4 with SMTP id a640c23a62f3a-a5d5db75a8cmr230662866b.37.1716087042628; Sat, 18 May 2024 19:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716087042; cv=none; d=google.com; s=arc-20160816; b=caDcr7IGM7IpAwd9beDAKt5Y/1pH6xyAMl/aeFKwxbO6K6FXPCF6DL3V7PtrYdkNIJ j0RQ5WAXi2MHsCjR8DxUGw8do1ftfcKJrjB+dgV5sKqqPexK7dTM4/nebLCmYTetdzlr ZhksilPwMumneIHFmpQ4t8ykpw4SmTqHi8la3avNf3y2oN8b3zo26gJDF0Qoar1dU4Bi Lf1Z3wgU0PFJd70ua7q7voznuxkwEt1Zz617NtGN+gQhaa0Iv2DdRuOSS1CwdbYE+SRc EiZ17tMOUI9Mv7TqPxIW5lySogBS8pc/5520pz3+27zYZuZEZ6q2ZFNPu0BpJrq55yla Kd0w== 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=xgpL+K2/WJsihhDEZON4BWBHHrKS8SaHzF7giMUUCZo=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=OzL0oWDUHdmx/BTUYYuxNVrAI5EIp7VFfQ6inXDwYh+dw2AhUhFK1FlhZkiNt3mvaD c1G6w7lLhn3d5EdjZ9uYW/ytwh/cQq8/8ltZQVaC2ojp+3WqJJRxtDCQySTnxpOmYaEG NGJk5ma5F0MyMagfXX4AhTok5ujUUpmSobKcO7z+f6N2s6jRnq8eLzfLDSc1Q0qd2CNS mC8FtQJAKFhTrGRbNjsZWiFDHIKLHZIhncFCbCXF1jhM6MtZPCkszyLhdEi5LsTY/ncE /N+8qPyNRtHk/hkaq18FSfEu3tOo4miw5IXYNUdr7YsTYB28bwZrT6eaMDMCkq+r6NJp 4DzQ==; 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=IaPe9EVt; 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 a640c23a62f3a-a5a17be6550si1115032466b.768.2024.05.18.19.50.42; Sat, 18 May 2024 19:50:42 -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=IaPe9EVt; 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 A81F368D261; Sun, 19 May 2024 05:49:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 49A8968D22E for ; Sun, 19 May 2024 05:49:26 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A51AF1BF205 for ; Sun, 19 May 2024 02:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086965; 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=ShEJe58og+Vpobs+PzNSTrJqv+1F942gfm/7odkXsrg=; b=IaPe9EVtelBF55TUTCRRhFP4sSJgbXxy4F05NHx70ngOedtHMOpv3ZkowkRo+cTizW5UoZ Vc9bSERPUJHtOj2FhpRZ06DYIpg6vq5vh14RY7MKr9nQE5BJRVopE2079UaCOjorNZhgQa zfSi50AKapzsu4RoOffHEHkHOMFhCdbKCaR+qYqOBmgKhyNqDNGggo4Oq0aaW9UYRlMp+o FmXGTuZAeGEKuj8E8nWVZ1BvhuXE3uUhJm8zIGW5/LxGcuA7NMU3vrHAdKBC4ZIPdPZQXD tbMIfB0ZWTHiw9IR+H7EnVVRy1U8qrULXgZaPRgtxvCqJu42RDaEzqFsJfv+KQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:15 +0200 Message-ID: <20240519024915.1944150-9-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240519024915.1944150-1-michael@niedermayer.cc> References: <20240519024915.1944150-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 9/9] avcodec/wavpackenc: Use unsigned for potential 31bit shift 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: DALh24B7Pvpi Fixes: CID1465481 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/wavpackenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index ba0371592d9..e99ab951d41 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -1979,7 +1979,7 @@ static void encode_flush(WavPackEncodeContext *s) put_bits(pb, 31, 0x7FFFFFFF); cbits -= 31; } else { - put_bits(pb, cbits, (1 << cbits) - 1); + put_bits(pb, cbits, (1U << cbits) - 1); cbits = 0; } } while (cbits); @@ -2008,7 +2008,7 @@ static void encode_flush(WavPackEncodeContext *s) put_bits(pb, 31, 0x7FFFFFFF); cbits -= 31; } else { - put_bits(pb, cbits, (1 << cbits) - 1); + put_bits(pb, cbits, (1U << cbits) - 1); cbits = 0; } } while (cbits);