From patchwork Thu Sep 6 07:38:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 10245 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp183820jap; Thu, 6 Sep 2018 00:39:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbxB/wmSekRPw2PjIekVX3dFdgtXOLaJjs0jQCSqqGeAgWDNYYTksozSuBiotLCTg0M/5AA X-Received: by 2002:a1c:570a:: with SMTP id l10-v6mr1338400wmb.56.1536219549169; Thu, 06 Sep 2018 00:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536219549; cv=none; d=google.com; s=arc-20160816; b=LwoPrQ+I0vTcPB0LnKEuEZJ6+0aRXEiVmocvjO0U3gfmuC7fBBNl6fqeDz6MJ97ZXz +AepHjeqhTZJe1HmxHaUFTk7f7DfHfdhm0Zq6i0Yd2i8qiDRZBkcODxWXMj5xZ02IKkE tJzBVZrAOlPLzlLiMuHAPy6SjbOrtcFhnVDSovqKmLJIQ6x52Ftyz4bg2Z/29hcDN5r3 WjxkmJoxFA/DFVol2LwCxGtIkjPwzxH337AlUloDEGGFbbVdTk8gBmHQBZ/jQHf/91m0 ZzWIT6n8zE9fIulQa3kW8/8v3y5VEKb4pzWkduDmvc/kSadSgfvWLJ7YVp66CsxLjIBI HhzQ== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=PevTd7HtvmxR2HXtt9TOMruYby3gd9Aeo757Oq6WGGk=; b=FAI/qT7iKwD+6+hpl+bd2n4VELKJvmJRFmem56IrurqNGNxH4JXt6JtZ8IaPM0UbR3 D/QpATbzKwMmrm6oTBurpRS8UbFKVRJr7kK6cRBxf950meGe95TIuRZeJFqf6GIBC6l9 1wszn/Et86IXD6uGdc9+u7vBdXPdC/3zWCwckelNgMGtnlHodJngPpPSunqzi5NAzMr9 4/flMvs7hIggUvlfbEF4LkpvQpAqwL15ZjISNo1wBvqP45Erj2eXYwK6OtaR/R9lhzTr 0PASql27AChI9wrOE8Qr+FQDVLLqEm4aF3Q21GVHkBAtyXDBYsu3aby7i4kCp+SExo18 5LOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=RWHdC+aq; 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 i7-v6si3597100wmd.3.2018.09.06.00.39.08; Thu, 06 Sep 2018 00:39:09 -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=RWHdC+aq; 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 CD5D4689F4F; Thu, 6 Sep 2018 10:38:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 907F5689EDE for ; Thu, 6 Sep 2018 10:38:51 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1536219524; bh=raO3vqr9ebJGj/DtVj+DTbbIkn9tf+lzt0t1DVhUIfY=; h=From:To:Cc:Subject:Date:Message-Id; b=RWHdC+aqh66g+XrPSeEzKRoPEgxZmtDZCVBnGllFoU0YIyjCYNKyjX1sygMZn7yiV K4MEmzIAQMGO+pouqMwyLM6DVF6fX+Dk+OiZ/IXzOJZt+r9pE4ZU+8q5QNaETgcqyn UbqNIiCRXCfAFTPJUWOrmmm3MWOf5/6yhwNcOaM4= X-QQ-mid: esmtp7t1536219522t3oov82gr Received: from localhost.localdomain (unknown [223.26.106.80]) by esmtp4.qq.com (ESMTP) with id ; Thu, 06 Sep 2018 15:38:35 +0800 (CST) X-QQ-SSF: A1000000000000F0F91100000000001 X-QQ-FEAT: N1W7FB+BIMpDMREbIA+BHwF9xjLw2YMIsw1cUbXKcgSzOOVPnOln/6jB+gE7V /ZgDffzlpSX1KTaneEzdn2LyNcWUXG1/7FEpVj8jf6Blez122W4b9rqvUOgQuzOCsvKNPkm d5oqShHCHfIDlOj709OSWCLCSzrYsHiNFx0eJgFvrkyYaTw9e5DJ80NZ+Iu4gcGfhF3YGqi PfQRya4+XDmayRlXu338dbRMcLbnhcWfqPxl+0GztvBuc828dp5I9491O9A+zhMSz8gVqT1 cUtZ1jXYARcfBfdrgzbP88oW8= X-QQ-GoodBg: 0 From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Sep 2018 15:38:28 +0800 Message-Id: <20180906073828.30903-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.9.5 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" --- 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,