From patchwork Thu Sep 6 09:01:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 10248 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp243861jap; Thu, 6 Sep 2018 02:02:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZLcky1IclxqpFh91DixkRCzKRIwbVfwy0oPjh2Wxd+kblMK0ezv0888Po2RZyhDsnPC2L0 X-Received: by 2002:adf:dc46:: with SMTP id m6-v6mr1563588wrj.84.1536224537410; Thu, 06 Sep 2018 02:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536224537; cv=none; d=google.com; s=arc-20160816; b=MCaKbsGZF1t17124Ly/lCMO3iv4Bn8iVOCI8InmaCbE++C15LsDZvuV1c8OixAnCiU vg8XX9bbFxoX3OnAYjxs7N2aQ+51Kr6wJ8R9Gn/A/+8bnDSeZrmlhIKcQNktVr019/yi xF7QrbFM/tN7jv6jDIrIX5ITX4mYvzmy9zpFYyM7Kv4WCp7gYHa8PgGXqhQ55yQ8jyKP jbSQ4rw76CNTenr4lR9nnPSxU8KKWEwGx7Vu2+KGf4NeeL/9ZGjqqtkOXVC7fe/lmfWm QUxXrStaPa5D3cCOUXTQAJmHFI8Zjc9FrfaXWPIffzpEKIbpy3w2E7i8oqR6aq2AMlM5 NpSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=Ns6iHH45edFMNszO4rhjce2+LF1GCZiOvBj49qCEO0g=; b=RLw6k5gFUjuoeso25cFp35KEj2hvvMTP/7vH/NB6SGyZtmjh5gesEQAz09N8NQJJhD 4hsc+uSL9S25EXmzTJ0BGCs8iLNnXwk65NmaVJYJTCqSw3/uptpg8080VEQ9GXDMRrRo h9mryFk7MgpgxZSM6RTmYjN+1Q8u1UZj+68TSj7dlzth89kXw5Q0ImYIz3a4YiUmgV2a gOXnvxUTCvJu98sAYmTXZEubkBjbacU0OWnjVPx2+pBGdzQmfC3LSy33/+GWoM3CyuXm vaB7/kzVepFiYyyaCOHN9NbMB9qQwwK82fzXazI1461ZzIDDRD7WlIPYa2VyjNa1KmyA dBMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=SUBUlfvk; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y129-v6si3629177wmg.94.2018.09.06.02.02.16; Thu, 06 Sep 2018 02:02: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=@foxmail.com header.s=s201512 header.b=SUBUlfvk; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2D5FA689F37; Thu, 6 Sep 2018 12:02:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A7CA9689E96 for ; Thu, 6 Sep 2018 12:02:01 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1536224525; bh=Ccwvt1d+GJ3r0EAC7VlwuNPMmw+jKvLFRUe2rb3/5tY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=SUBUlfvkF5eGJ3InIooBhdQ3n545T1cZ1euAt0e7maRRCgLhON/EFac2226Qb6g4r qdFichfZnP06s+umDhZyxrMzRMJ7cZC3X0SuH3b5m0inCkYvVexX8l3SjLMvIcWjYW 4sTWfK+8yr8nxu8ym/OJt7kAZzrAwP2g5Ewqro6c= X-QQ-mid: esmtp7t1536224523tsny8zgxa Received: from localhost.localdomain (unknown [223.26.106.80]) by esmtp4.qq.com (ESMTP) with id ; Thu, 06 Sep 2018 17:01:54 +0800 (CST) X-QQ-SSF: A1000000000000F0F91100000000001 X-QQ-FEAT: uuX/0Mknq+plwcL+GfgDqziyujfsvV3gkGx4PDxWl0VpTgYM76FkHewcjC0OQ /R0J1Tx6NoKuRr0bFtYi/8/2/Z1A0yg3nF4CA9HHDEsOwaIPJGWlVKX6ADUb4onZlhfCEsB AE/IIAHU6a84bj06wok0nst4D5lqbJRClBw+EAOm1ZYJB6de6DBAik+oI6LPKvaVHRp9eWO va/9B/8nQDwOTK+sUnNHsIz/N+a2uQWROEMLvKrSY2DhWs4lM2v3FvHeBfnMUxCRf/Ia7MB MsBGag58CKLdjiHUVmqhZ4LiK/X/Ddp1pnCA== X-QQ-GoodBg: 0 From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Sep 2018 17:01:49 +0800 Message-Id: <20180906090149.32444-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180906084331.GN3200@michaelspb> References: <20180906084331.GN3200@michaelspb> X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign2 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] avcodec/h264dec: remove unnecessary checks in h264_decode_frame X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: Zhao Zhili MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" These conditions are checked again in is_extra(). This patch makes no functional changes. --- libavcodec/h264dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index b2447e9..bffce52 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -1000,7 +1000,7 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data, &h->ps, &h->is_avc, &h->nal_length_size, avctx->err_recognition, avctx); } - if(h->is_avc && buf_size >= 9 && buf[0]==1 && buf[2]==0 && (buf[4]&0xFC)==0xFC && (buf[5]&0x1F) && buf[8]==0x67){ + if (h->is_avc && buf_size >= 9 && buf[0]==1 && buf[2]==0 && (buf[4]&0xFC)==0xFC) { if (is_extra(buf, buf_size)) return ff_h264_decode_extradata(buf, buf_size, &h->ps, &h->is_avc, &h->nal_length_size,