From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 11CF646D45 for ; Mon, 10 Jul 2023 00:56:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EEE5868C64C; Mon, 10 Jul 2023 03:56:51 +0300 (EEST) Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F342768C2A6 for ; Mon, 10 Jul 2023 03:56:45 +0300 (EEST) Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-1b0249f1322so3279739fac.3 for ; Sun, 09 Jul 2023 17:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688950601; x=1691542601; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gNZB339n8f4zXOCpnwI5vb+SiA+tTeZI10+kSs5xBRM=; b=ImQkJLP8zpItc6H9aMeOUvhkyRTOpiM1qvlPwRnjudWzS1EEoqOynHSvLLmNdSgk6w QTR/rr9ZuIyIbU6lPpgcNpHSQo7UsZE9jCbSZ51NED8qjf97gTk+KnaPpC3ckXMZ+KJD azRnq03HrP5CKCgFxv++7emZIVvXfKCSx9mJRNn+SfkmlZd6T079dPW5QTuQ0Co4Yybw HEUtwzSc51VfQSn5K6dGFiYtF5tVwcQvig5RjU6cTMy6BJk0LSuef0IPdgkHdAB+RmqW y0wRSzYBVIZ2gfsLMLZ6/VeX/+j0jyqpcEgSbqvYiAkbQZHX5lQfgAeNtdzIxkefunoV w3kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688950601; x=1691542601; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gNZB339n8f4zXOCpnwI5vb+SiA+tTeZI10+kSs5xBRM=; b=el9jYSX02BmIH00C+XvCx2EjOisMu356BkCnaai6CpcPgsMPqdUXSOV/lUT2HC0gbh NpV19SkU4l5wGmqkpjwD2prbJHTq+8S4VAn6MT5eHhdv0Q6Wy8Sw8z9P9Y5j3TQ17k5A oHPBgp/BJBkHTMiIiHIwcSesBdIqrfBYzEGOqt6QY+h7ArTTEGOm742jzL7mouM65N2C NO5xF22xljuo/EEjrhWAZeKYLS6+maZSS204g8CR6oPKqZ4ePO6EFg+/m2dgWdi2AwgA /Gbc6Hdxni1ky4X5CEodaR8qEKqljLP5IVqpgwZZ4+QncVF3m9GyhPXE/yg3v4wkZ7Ut wO/Q== X-Gm-Message-State: ABy/qLYG1mcxZ0MIMiO/+dE60VRMfQ8wfxWTHssyalDGdzidLznfgNuK wzNG/cAcbfty5x4WwekSAs5vGxHbKrM= X-Google-Smtp-Source: APBJJlEVnIo3/+JGJ80DBKT7pRzDliaDEvRDuo8sIlwLnfBqV1KGavKkLNKY7JoIqfEEMOu1BPzV9g== X-Received: by 2002:a05:6871:8c:b0:1b4:5bd9:9fb9 with SMTP id u12-20020a056871008c00b001b45bd99fb9mr6499062oaa.43.1688950601346; Sun, 09 Jul 2023 17:56:41 -0700 (PDT) Received: from [192.168.0.12] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id o19-20020a9d7653000000b006b1570a7674sm3819319otl.29.2023.07.09.17.56.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Jul 2023 17:56:41 -0700 (PDT) Message-ID: <23329244-d939-61cd-2cd1-47cecd343ef7@gmail.com> Date: Sun, 9 Jul 2023 21:56:42 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/hevc_ps: Improve PPS SCC extension bit depth 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/9/2023 9:19 PM, Andreas Rheinhardt wrote: > From the spec: "It is a requirement of bitstream conformance that > the value of luma_bit_depth_entry_minus8 shall be equal to > the value of bit_depth_luma_minus8"; similarly for chroma. > > Should fix Coverity ticket #1529226. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/hevc_ps.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c > index 4c4c1e2c17..1db2d3a242 100644 > --- a/libavcodec/hevc_ps.c > +++ b/libavcodec/hevc_ps.c > @@ -1581,11 +1581,13 @@ static int pps_scc_extension(GetBitContext *gb, AVCodecContext *avctx, > } > pps->monochrome_palette_flag = get_bits1(gb); > pps->luma_bit_depth_entry = get_ue_golomb_31(gb) + 8; > - if (!pps->monochrome_palette_flag) > - pps->chroma_bit_depth_entry = get_ue_golomb_31(gb) + 8; > - > - if (pps->chroma_bit_depth_entry > 16 || pps->chroma_bit_depth_entry > 16) Is Coverity complaining about this duplicate check? If so, you should mention that fixing the Coverity issue is a side effect of the compliance check you're applying, rather than the actual objective of the change. You could also replace one chroma_bit_depth_entry check with luma_bit_depth_entry in one commit, fixing the Coverity issue, then this compliance change in another. > + if (pps->luma_bit_depth_entry != sps->bit_depth) > return AVERROR_INVALIDDATA; > + if (!pps->monochrome_palette_flag) { > + pps->chroma_bit_depth_entry = get_ue_golomb_31(gb) + 8; > + if (pps->chroma_bit_depth_entry != sps->bit_depth_chroma) > + return AVERROR_INVALIDDATA; > + } > > num_comps = pps->monochrome_palette_flag ? 1 : 3; > for (int comp = 0; comp < num_comps; comp++) { LGTM either way. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".