From patchwork Tue Nov 22 10:06:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gao chao X-Patchwork-Id: 1527 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp2102992vsb; Tue, 22 Nov 2016 02:24:42 -0800 (PST) X-Received: by 10.28.17.205 with SMTP id 196mr1584778wmr.78.1479810282587; Tue, 22 Nov 2016 02:24:42 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k11si1719466wmb.125.2016.11.22.02.24.42; Tue, 22 Nov 2016 02:24:42 -0800 (PST) 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=@gmail.com; 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 dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5B6B0687ECB; Tue, 22 Nov 2016 12:24:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1E01D680D0B for ; Tue, 22 Nov 2016 12:24:30 +0200 (EET) Received: by mail-pf0-f195.google.com with SMTP id i88so1155453pfk.2 for ; Tue, 22 Nov 2016 02:24:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=TzOOe4zYZxCLg78hNdUSIBIeMaZ6hsiwpeRrUZ/bpq8=; b=IYyvV5JQPby4J8s1vcH+dNs5CbMWuRih2b82Q1v0EsLmcdHpyeqknh71RIThW+/XSK 8akeTOhTzPYEVR6Y+i9CZQ2W0c/k8gghEgvS1fM6m/xgxOkgGcxUdaukDEmagxd+9iyb +6aPew3i8Yzdks4VzzKMunFGZGE2tVB9CKk3pqsorVGe+6qaiOqmXdvoWM9h/XBQnXYd RBDaHmYOnbZjaEqM5ulGdQVe9cInkN4sr6NpqCh+IPHSzEM1U6sza5RG0Qqlxn2M2vf+ t+xSZu7432PpdqvNoDMMOS02nljbVMYniYlzjutxPnT9OETAuolStP3DBESJeWoianxt q94Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TzOOe4zYZxCLg78hNdUSIBIeMaZ6hsiwpeRrUZ/bpq8=; b=d8i7erFKPVgc9vtRoYftWSZWQbPGlhLbmwJJiRdNrX8LtSyMiWuO4EBd6kQuWqeUhR 1cdn/fosQdZBu1GoD8WNFDrOqpXYW19yl9EIzdUiyScOW2Ut3Z5YCAMn+yLD6yw1lpbh FBXSu0OKDS9AYGATdZ+p3eHUkbxkXDokMqkQ+CGbH9K7O18UCpij/bUtCX9AGVJ0ORCL dh9KCb5EzcoCKtgfjQDuSjk0KchqDLqZr4PSk30Rbj4lMGVU2ZCO/xmOli+BO78t0Vhz bQVZ3hctGKeOCN+qMM9/OgQksRwUqfzS7nb73qd6ZjxwnDJfh9NGw1IzVwBIM/pJtBOQ /b6g== X-Gm-Message-State: AKaTC00d49neZmuU0dkySzxqR+66WIYpYRjtG/apx1blN3x1zvX4KqChlsdyi/yvAfVO0A== X-Received: by 10.99.4.213 with SMTP id 204mr42355971pge.77.1479809269273; Tue, 22 Nov 2016 02:07:49 -0800 (PST) Received: from localhost.localdomain ([117.136.0.178]) by smtp.gmail.com with ESMTPSA id b80sm43871563pfe.52.2016.11.22.02.07.44 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 22 Nov 2016 02:07:48 -0800 (PST) From: gaochao1 To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Nov 2016 18:06:44 +0800 Message-Id: <1479809204-85662-1-git-send-email-gaochao1@gmail.com> X-Mailer: git-send-email 2.3.3 Subject: [FFmpeg-devel] [PATCH] ffplay -vcodec h264_vda *. error :segmentation fault. bug fix. 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: gaochao1 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/vda_h264_dec.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/vda_h264_dec.c b/libavcodec/vda_h264_dec.c index 92839e2..809c2f4 100644 --- a/libavcodec/vda_h264_dec.c +++ b/libavcodec/vda_h264_dec.c @@ -226,12 +226,14 @@ static av_cold int vdadec_init(AVCodecContext *avctx) ctx->h264_initialized = 1; for (i = 0; i < MAX_SPS_COUNT; i++) { - const SPS *sps = (const SPS*)ctx->h264ctx.ps.sps_list[i]->data; - if (sps && (sps->bit_depth_luma != 8 || - sps->chroma_format_idc == 2 || - sps->chroma_format_idc == 3)) { - av_log(avctx, AV_LOG_ERROR, "Format is not supported.\n"); - goto failed; + if (ctx->h264ctx.ps.sps_list[i] != NULL) { + const SPS *sps = (const SPS*)ctx->h264ctx.ps.sps_list[i]->data; + if (sps && (sps->bit_depth_luma != 8 || + sps->chroma_format_idc == 2 || + sps->chroma_format_idc == 3)) { + av_log(avctx, AV_LOG_ERROR, "Format is not supported.\n"); + goto failed; + } } }