From patchwork Mon May 6 01:23: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: 48560 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:e68f:b0:1af:836d:81b3 with SMTP id mz15csp1118386pzb; Sun, 5 May 2024 18:23:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWt/ukiyHLdBdzrUil5qFNa4J4be1EPE5UqaZ7c/cacSv64FeP9ul/UJDuY1I6eQL+7hc/jZ9GXGS4/JR2tjWx//lnmmvhJccBXyQ== X-Google-Smtp-Source: AGHT+IH8zybt4xPLV8eXJE3VKBSpFlri8N0wCf1uI5AmdVffLcofw19NMAAkPaKMJMfHvTE5N3jE X-Received: by 2002:a05:6512:32ac:b0:518:ccf4:bd0e with SMTP id q12-20020a05651232ac00b00518ccf4bd0emr5452409lfe.3.1714958599054; Sun, 05 May 2024 18:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714958599; cv=none; d=google.com; s=arc-20160816; b=O1+fi4rVhQXnQDWsjEkso6IKzRx5FcwwFuTaJ78LiDF3P2V30sMXUdipjBNEylFw2J EsaWGd/mV+j+zu3rIrgB09TOsRWPwt2+hXDmHSIKJUK9bfN5WIvPE5n5JIv7C0zXXfOT r31EMJWztF/f4UkdpSmugr6ZdImBwYedUHmRM34ZShnQMtS9tcP404G3zrFRXXev6I98 6Eo7eltIGv+nt1hzJaZkH9K0/86QeiFBShBuQCa+6RMZUsRe2xl/6XGksCEr2UoFTnQy 6RYybXpptsVTTDfO/NEev2JK8j2BMYeD777RponvgHdK5isWhHfeivDfcHecoVJT8NmV NJ1Q== 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=p7OU33T6NdrSRonOmHpIHJ4InSBebxWOznvOeisyQL0=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=wWtKLDLNjbKnltn9+u7ObLUe8zMON3N/pV5k738PeARv9YFCXCGYB2CziB7GG6ByCJ KVm0Tt+llYUCNyEaHS+t7s1oK6wwOaZ/ZVfsuuSVkl+TYd7o60h+FPcL6nCJYZbAj7Xd rqNSefpdp3YOREonCmzb7OmMbi0/Nx/bLj7+yn7jith0p6YnIb6MRdHY53KrMhfjAB/5 P2xnbMIlZLdYSm4FvFCXGB4y8gtQie7R54hO3RmsVIt62KFgPS3mPhy/GEluo3rRnJf4 pVcHAWTqnnTdVZRl07sO8skPLbo46FI2QlsJZruJ/iBGhjuHGJe1lJH6qXc5UEZjTlQt 7EvA==; 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=o+MFtzrB; 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 s19-20020a170906061300b00a5741f4b33esi4138035ejb.441.2024.05.05.18.23.18; Sun, 05 May 2024 18:23:19 -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=o+MFtzrB; 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 448ED68D503; Mon, 6 May 2024 04:23:15 +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 056DD68D503 for ; Mon, 6 May 2024 04:23:08 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 29A711BF204 for ; Mon, 6 May 2024 01:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714958588; 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=0lEEDlc/eo3AQunttSmDw5mpnlC1nx+xc0aZ+ZL9U7U=; b=o+MFtzrBwoZKOgrAz71o6NUebXfvw4xCyECv+QFS+xKjg0vru83n059f6g5EF1CkdRVV+6 hJDcepnAgFQZ0M+/Zu1L8jIurBVyHytcPop7mKzoviUt11yvzq0YvmQ3VThjMqs79o9lvG AXN0lNQbr/nFc/XcZcL16KrzXN8jKsZ0N4XNDVcvP/v2g++fKp4UbG6hAVqfjhkOHHIH/l F/he6TZGig7PZzHH9f8fIX4G434/O3Oghm20QmAza9zQmz6grrKCjgts/VSpYFxCKRMi0t dzE7/6ADomDZYQ5kmdeCaqu7k4m30Hr/j99fbdWMmPIyJlYg+RWHGwLttfdVeA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 6 May 2024 03:23:07 +0200 Message-ID: <20240506012307.807589-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] avcodec/h264_slice: Remove dead sps 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: Khe+RNk+5POn Fixes: CID1439574 Dereference after null check Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/h264_slice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 90d37f60848..ce2c4caca1b 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1396,7 +1396,7 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, sps = h->ps.sps; - if (sps && sps->bitstream_restriction_flag && + if (sps->bitstream_restriction_flag && h->avctx->has_b_frames < sps->num_reorder_frames) { h->avctx->has_b_frames = sps->num_reorder_frames; }