Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1044139iob; Fri, 13 May 2022 20:52:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgVgciMmhFyThgoB3VfhoGM7rr40IF6te33o8EmvSta9yCLxCNn3mDY1StDQwxocDVypmB X-Received: by 2002:a05:600c:3ca3:b0:392:990b:af11 with SMTP id bg35-20020a05600c3ca300b00392990baf11mr7201044wmb.173.1652500327621; Fri, 13 May 2022 20:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652500327; cv=none; d=google.com; s=arc-20160816; b=vRD4Xw7ULMYCGHlSBwGmXCStz0hlXwf5QMJMDVLAJQK/fwf0loG8n4hl0umY0KRX6a HZPVgwNGHDPeONgTT9hxwAR621TXnosaQP3bzO7e4svHuvr/lZqYoAtiz3mYVme4CJLN huDvcaKsEIaQfWy09ewCBQFKzPr2JPMhd8BCVX2SqQN65pqtELIkLTMTKa9Sfv2VOEQB HLthy6eoYwmveXtz6UQTAjxDcvG3QlWO0ECukTIg26d2CGWCdNHAfEzmviQpsAU4KFrb CcVqHbzXRxhPntwx4m3gqXs11Bzs3rlAtoGL1kqlVyrSPEiT4PE25/bQQWeH3NzXsZcn WfGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/AD9bW2iPnSe60c8xsO4dLOqYL4ulPeQkV4zFTrqJ9U=; b=yfwZnOrfn5w9vKWNEx9V/cUpJmaWI9chrKgAYNHb4p+ByrqmJPqc9NUOGifrNHF+DC 1nn1FAy5ApdCtpeHuB99kEj043GuOIDAv42OlFZCpK3ON02F3Xs4mZv9VNtoMOh7SWcN d4lPcHPDN+qttPQhfHSrn2WSLAy7CQi5uXHD0sK0hSQSyKHwLb5lsOX3d7tt6Om91FHO DJkei2HKtBVuGFKyX2j+yP+A2JNAFq2VuwoqsTOi3yiy05cqnApXgStgA6iymovj9DBF QSrCauO3zGZ3INy2skmdOGMP3d0p3JSHliW963pIGhXWvd/JHVjIbMiFWWykxd5lT1uj pUKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DRcfnh3o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g8-20020adfd1e8000000b0020cf516f895si2269774wrd.882.2022.05.13.20.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:52:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DRcfnh3o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1C59747DEAD; Fri, 13 May 2022 17:24:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384548AbiEMUc5 (ORCPT + 99 others); Fri, 13 May 2022 16:32:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384461AbiEMUas (ORCPT ); Fri, 13 May 2022 16:30:48 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDBD37355B; Fri, 13 May 2022 13:30:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id 7FC571F46483 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652473795; bh=HEETDTFaV8Jr4FyaHgjigxD+fRrzRsYiKM7mEOGoNmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DRcfnh3oM2e+iY5OVgfBPViyB1R8HzRN7EGwmsv0HiWeiKn8/prlTyovriPq6aAGi YelkJEHGWZzlu8MFXOSCTG+7/BkAjSe4JxuTh7oqVNvOG+WguOdn7SRa+eNFe9loh7 C9TlKiLRKEjVZgR7D6mqqyxBOQOlWBcZ49QucyW8xAet+9K4cCJfTmgKWC26E32uoN S7QrSxgu3duuuaGPweLKsq9EJqjEKT/g0BY98q5IKNH75Ka2UPQ///34Z222qALPg2 HhyODvB2NtFiJ/ratDO2d5/qXSl8JFIWZXZjgahYXcnvlEqD6mpgFmnfh4pPCmVEYB kQnmBKFOn7gHw== From: Nicolas Dufresne To: Ezequiel Garcia , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: nicolas@ndufresne.ca, Jonas Karlman , linux-media@vger.kernel.org, Ezequiel Garcia , Sebastian Fricke , Hans Verkuil , linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v5 13/20] media: rkvdec: h264: Fix reference frame_num wrap for second field Date: Fri, 13 May 2022 16:29:15 -0400 Message-Id: <20220513202922.13846-14-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220513202922.13846-1-nicolas.dufresne@collabora.com> References: <20220513202922.13846-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonas Karlman When decoding the second field in a complementary field pair the second field is sharing the same frame_num with the first field. Currently the frame_num for the first field is wrapped when it matches the field being decoded, this caused issues decoding the second field in a complementary field pair. Fix this by using inclusive comparison: 'less than or equal'. Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil --- drivers/staging/media/rkvdec/rkvdec-h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c index fb41e2fd8359..57821ee3b213 100644 --- a/drivers/staging/media/rkvdec/rkvdec-h264.c +++ b/drivers/staging/media/rkvdec/rkvdec-h264.c @@ -782,7 +782,7 @@ static void assemble_hw_rps(struct rkvdec_ctx *ctx, continue; if (dpb[i].flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM || - dpb[i].frame_num < dec_params->frame_num) { + dpb[i].frame_num <= dec_params->frame_num) { p[i] = dpb[i].frame_num; continue; } -- 2.34.3