From patchwork Mon Sep 3 00:01:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 10207 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp2087300jap; Sun, 2 Sep 2018 17:02:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbnE/BeXdMTRStU+lYPQvrEtv890JG5ixxnXas5xVzIvHGLpNdGRTUm1hroCZSNfSWvWuAA X-Received: by 2002:adf:ec05:: with SMTP id x5-v6mr16883255wrn.266.1535932923854; Sun, 02 Sep 2018 17:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535932923; cv=none; d=google.com; s=arc-20160816; b=FqS+4+WTvu4r3kjlxcHSGaDuWYhE85z3QSG4S6Nl5KYegCN9iJsEo7omho2W6FJapv 9vJkijKsHoZjoSqdo5To6YBK1PPNt4FUYFhSozDUwYSZ/y4yBPHq8Qd8NzhRuAzH5TLc fQxQTAZgc/D+sm1LJ24kRMUMGYN/so+ftKRV2ArLA2EAc5aBeyWwfHUF5e6lYgF8nrxN lbWU0LxmUoFOUSig9yUvGf2XeV6CGwQ9g7c4ITWL/YMfiMGEqaPDLtNEKgSDSHIxIg+s rQPD/s0NOt7nf7uzv/rNoov+bwewrqNjbB156xeuflSUvLGwUIqfi/Rhf0Pui6Hd6wKd SWiw== 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:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=vv9uc8/inahrh4e62hQh0s3wfpQSFdTMLSm40jZ/anc=; b=DZZijr1iZ4E8RHqFRkSUCmVYxm7n0YlTWLlmdI0SmQLOmGb0fMpWXMHWbizqoF6Kgt XGZuiv/gx2w3uYsiYjAJnf2LsOiTzaIoAPrOABjTiTF2qXK7yqBG6kYu1D7Rtsb5Xvdj 2ATw32U86JfhF/kqfewNfNF+yS7AGGdYNopCp8GZ3FqPJotha6YLJPnRrGrF9IcumTG8 oXk7tu99rAPzHtzcst1+wB45MkUXsTrvf/NEsg1q6moVHGDlwOSwz7dPFvcIZ1lKKwky PoReBLL89hiwz1YlZZLKuIffVFP69ycUJTjARj713Zl4bhALFrA8RAVmLMO9U4KQzBrh TwmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=WwwijMjc; 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 c4-v6si7922364wma.99.2018.09.02.17.02.03; Sun, 02 Sep 2018 17:02:03 -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=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=WwwijMjc; 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 8462D689AF7; Mon, 3 Sep 2018 03:01:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 28405689A95 for ; Mon, 3 Sep 2018 03:01:50 +0300 (EEST) Received: by mail-wm0-f44.google.com with SMTP id r1-v6so5384581wmh.0 for ; Sun, 02 Sep 2018 17:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=F2byUCz4pv/Ar+EJgxbkFJBkY2HTABI3MzzKs7/ZIJM=; b=WwwijMjc3oGgwtHk3Bl3BCAAPwqW6JBRlwmOVdYaZFcP0FS2TKJwnSCslrYS58Ii+X rCaucfXzcNh4MbTaaH4Euq5nju3jForhxNKY+39SPKvPwogh6z3yiBsO8nLS4RPa7IBS jLWYv5Rt1CrTVz3pCfoi2YMgPye2M/WzInS1NqupHHWe0HMP3tb1bEcGTyW63o1rylHs rGC1NwSTDyqrHFtOMluT9taGyFjpFzRNiPIKJkejio4fIebG8B2dujWIGAAJby6TP58x Sim1WKKTxCSMfnz3ZV4c0neAMcbWshQklw0zsvlzBZsU2e8yME3B1d4Vjxn1rYI8neRL CnhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=F2byUCz4pv/Ar+EJgxbkFJBkY2HTABI3MzzKs7/ZIJM=; b=PMAGXd9618m+RWdyCUEgmYAH81VSvAbzDhb805dchS6kxFX+BA+975EvtYV/hZATcK Ip+Y5qY0N0NazYHNLlMPUij8wWVGCnu5BGAOkI/qGptLUluRshjW+vFIVTJvpeT+sQYi LvHUWAgbwGxVIGVyHlD3qczddqoDgiehYE8QZid9WGAnst1GbDOYZMRBOdmcdDaqXnYy wsLwz7SfNxNQ51Wl0Zpxp7c+5D90dh+cgCfDUr9/Plzhdp87AOwEFDG1aHwVspVBbKLd i7RmONwJNeBZEZlNNxIhAW16TqXByUFj+nEvQBOIN+E1Iol3Lu2bXRL9SSRqwFk1oKLW QwpA== X-Gm-Message-State: APzg51Bgo4SvZYfUq3yu/J27T+u0/JT9c1fLuj32ldTeQ87jcANGwgh5 wOTytPeNeiLK5QapQN5I+4nFAMFdfoQ= X-Received: by 2002:a1c:c64c:: with SMTP id w73-v6mr3305592wmf.98.1535932915650; Sun, 02 Sep 2018 17:01:55 -0700 (PDT) Received: from [192.168.0.4] (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id f18-v6sm15818676wru.51.2018.09.02.17.01.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Sep 2018 17:01:54 -0700 (PDT) From: Mark Thompson To: FFmpeg development discussions and patches References: Message-ID: <0e2286cb-cb0b-f8a9-fca0-c7d6f9fd4167@jkqxz.net> Date: Mon, 3 Sep 2018 01:01:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 2/2] hwcontext_vaapi: Zero unused fields of external buffer descriptor 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- Though nothing should look directly as these fields having random stack data in them is confusing for debugging. libavutil/hwcontext_vaapi.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index cc3739f6ec..9dc1d30d37 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -1039,13 +1039,15 @@ static int vaapi_map_from_drm(AVHWFramesContext *src_fc, AVFrame *dst, av_assert0(i < FF_ARRAY_ELEMS(vaapi_format_map)); buffer_handle = desc->objects[0].fd; - buffer_desc.pixel_format = va_fourcc; - buffer_desc.width = src_fc->width; - buffer_desc.height = src_fc->height; - buffer_desc.data_size = desc->objects[0].size; - buffer_desc.buffers = &buffer_handle; - buffer_desc.num_buffers = 1; - buffer_desc.flags = 0; + buffer_desc = (VASurfaceAttribExternalBuffers) { + .pixel_format = va_fourcc, + .width = src_fc->width, + .height = src_fc->height, + .data_size = desc->objects[0].size, + .buffers = &buffer_handle, + .num_buffers = 1, + .flags = 0, + }; k = 0; for (i = 0; i < desc->nb_layers; i++) {