From patchwork Sun Sep 17 03:20:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 5170 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp2196849jaa; Sat, 16 Sep 2017 20:21:23 -0700 (PDT) X-Received: by 10.223.176.132 with SMTP id i4mr24267128wra.13.1505618483351; Sat, 16 Sep 2017 20:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505618483; cv=none; d=google.com; s=arc-20160816; b=sP/dIQzeoydnhX9hZXwDpxL8aDUNbHRJtRcF3uw3yyRK/yBpXoHKmE9PWYOMBbJMgV 1zMnbrAvu4qn2VEV5bB/RFG4O8tjTSSXOKB4MSc/GtOrgkRpAcKwVqFQUbhWgR0F+dow 59MqgRf93oiKp2J18JxsoftJ0ZhZWMSKI5z81bx7NmGPmHZtXyWSBKruvMNcV1CWKsx3 h5J6Zo5uoa9ZUgI1GaoM0EBHGgXa6wrIY4TLZGXoRvvv/1CuTqHBRUqex+3YJeWZAB9+ i119LdLTs80vmI+Tlixw7t7jqffsbBZIDyGKV9qBuN8sEmZhwv9XgY2jF++vXkmlRFZ1 x0ig== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=oOuUIZVDiwZN89upwA8u8Q8YHxet8rebP+8m0zVf7Us=; b=XPQ+ORfmEelnmgvbWkRerurxkNTnxcwtIKIIiMA3qibd0WSckV86xitr4iVkyc1dtE SmKDVowZxt0IlrO8iyJG0Mvsm76gJ5Ls6dEosPlirkCRkCX9IJZXiDPrOtXq55oqnotU Q6SAEAyTiFFs4zPxyLcqK/tT0zCGh5Byu8I6e0HGGjGuyB7912roEYvw/CmYSS/tsagk gXD0OkHYth/pWKZGpbX+jIrH0U0vNzb1o3FFHnq/EM+54h+m3X1OqQPuVl/mIEA59yFu 0X5ZFQAupfSU3Tzbd/ctvEbUgTwfF+nAwT1/X1WIVTxVEaMV6sGdaZz473/XAd50XwtH f10w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=QT+LM6pZ; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m21si3598771wmb.103.2017.09.16.20.21.21; Sat, 16 Sep 2017 20:21:23 -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=@gmail.com header.s=20161025 header.b=QT+LM6pZ; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 508CE689828; Sun, 17 Sep 2017 06:21:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DE84A6897EE for ; Sun, 17 Sep 2017 06:21:04 +0300 (EEST) Received: by mail-qk0-f193.google.com with SMTP id o77so3700424qke.2 for ; Sat, 16 Sep 2017 20:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=fSoQvom3EcJMeJ4RBzjqg+tM6oJCG2w9il+2Z8GtYfg=; b=QT+LM6pZmtEWXVDIzqr+O3NaBMvqsA1QvdhUVnSzOmfW/SBDZjjiDuRDgo/+djv9u+ cRQ+LGficyZ7CnvSXLjYO0ZBZmorMGg0McVne8ZcXarXOktr9NZD2P7nT4IGWJYiRmSE RivEjnmK4JDjDVmivHlg4r61dv/RNNWz5kxxEnfOBn2QVhG2wsd4sa0AljYnJHqtv7op LhkA+Qi330cNDpe/AdjyzL8M/VP9HklQnSSrTLylpOABl6CjcGsvdGTJSMuMDvhVDE/d WkC8HE6WZVoxtj/WpehjiXRwhIF3d/ywRu6Pg0YjLhTn9t67IpepX6aUnpha6GetGMOA 3M/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=fSoQvom3EcJMeJ4RBzjqg+tM6oJCG2w9il+2Z8GtYfg=; b=INS9iGqfDEXQnem6puFwuqoWeM3pTSWuckctq8CQ5PkCQhmxjp35olIPGr/q95sm9X 1rkGumK3kI24xX/GZ6YPFAJSyMBtXwla1Ftm+HO5gnFHl/5EZdEABRslvzeuXL0o/U1X kjP+cozl5XEwOvEsAZj6wO0TEtXLYTDYNyYxZv8rgDTP3PJBKKdFq+UNrwy2Phx5TS2Y 9TBAwvql0V7NC4q0xqDuf+9qatbmCCNh57jBT6IBVDL9OxU0ZhwujOpXUq5o1OXgXd7G Fit9+zRhwq8czzUqq4S2kynJIiGcwituXi68NS3YrHYu+spW1eAU80aBn+3WCFGB5lrL X1iA== X-Gm-Message-State: AHPjjUjgMx07WYwwojERk24+ynoC1YSD+/0dus2aer2JJzUbBkzCiQND iNiRuJtrlpLuFE2H X-Google-Smtp-Source: AOwi7QCcQfnELx7gmyqgrSc9TcNEBbUjwmTuk8NtGvZJ9sRGCiSw1Y7PmlAO8YWaJiH++/J7xscCWg== X-Received: by 10.233.237.202 with SMTP id c193mr14967117qkg.290.1505618471317; Sat, 16 Sep 2017 20:21:11 -0700 (PDT) Received: from localhost.localdomain ([181.231.68.242]) by smtp.gmail.com with ESMTPSA id v92sm3019582qte.69.2017.09.16.20.21.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Sep 2017 20:21:10 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 17 Sep 2017 00:20:21 -0300 Message-Id: <20170917032021.3004-1-jamrial@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [FFmpeg-devel] [PATCH] avutil/hwcontext_dxva2: return an error when buffer allocation fails 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This also prevents the use of an uninitialized variable. Signed-off-by: James Almer --- libavutil/hwcontext_dxva2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c index 6c41788e2e..2ddd4be7b1 100644 --- a/libavutil/hwcontext_dxva2.c +++ b/libavutil/hwcontext_dxva2.c @@ -307,8 +307,10 @@ static int dxva2_map_frame(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame * } map = av_mallocz(sizeof(*map)); - if (!map) + if (!map) { + err = AVERROR(ENOMEM); goto fail; + } err = ff_hwframe_map_create(src->hw_frames_ctx, dst, src, dxva2_unmap_frame, map);