From patchwork Mon Aug 22 23:01:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Burt P X-Patchwork-Id: 238 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp1998235vsd; Mon, 22 Aug 2016 16:13:27 -0700 (PDT) X-Received: by 10.194.221.232 with SMTP id qh8mr21614104wjc.117.1471907607491; Mon, 22 Aug 2016 16:13:27 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o3si351668wjx.202.2016.08.22.16.13.27; Mon, 22 Aug 2016 16:13:27 -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; 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 8DFDD689BF3; Tue, 23 Aug 2016 02:13:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f67.google.com (mail-it0-f67.google.com [209.85.214.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2CF4F689BEB for ; Tue, 23 Aug 2016 02:13:16 +0300 (EEST) Received: by mail-it0-f67.google.com with SMTP id d65so6237715ith.0 for ; Mon, 22 Aug 2016 16:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=i3/G9mONeBX1oCSg13lgraRQ7DZLXXpNyvhA3KVcF7k=; b=EMYK2c3RyCuIfhQJyEC2GLiF8kuKqDggnWL/wqOsp+S/UQbPM37TkPKSHgWpsQxaum PlfpkFoP6g+RQmOUlk1BJEIL9mcBNRzu7i3AqCRoCvV1WhFjFo3bT5hxirQFAV83y96g 97J92fpVhyIUzIJuVsFao8w/9zeMaS/zVw+ue61jbnWN3KnitUyZF65+vDBs2JeUV3Zj QBWMeyF7qxZGv3jbNCcC3lII5m31JsURnAqN5gKxzMWKqdausVxj8CvYmFXJNDT2THk5 gC2K6l/8NEPfa4d6+NEY3ySznIKV7Rn/tPaKs/X1qU+LMvOjBFNPuCi/iLxGw8J/f2c5 kohA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=i3/G9mONeBX1oCSg13lgraRQ7DZLXXpNyvhA3KVcF7k=; b=nNhidESyCFyapOR7lhkVCF3RiQoKXRVJoGectsrXPoRT1Dy6XIrL+16bTyPKZzPtDB QWopuEn8p+7HaXA9GFePE1BblsxjtwvFgAqcMycg0g50iFfVBq44g/L9uhjFcT5IWMLG BpBgqXJZ1QWDDdU2Vs6C6uL1uRkXEBIuMLC2BDERE6e2fFy4lRhElDGghzBJAtcFphNW BQpNePGCKsSZIaSDNQwoBmsAgqg4Zz5n6BGIGZ4SPd9UbG2NVv8+GiQeoBT/dJ6Bg4eO 2WFx0sG+JGAnu75grLq/0bxrf9Qygaa/NjwsqsPivqEPZDnd3G7bJad8DPCITKsgv8Gl d1KQ== X-Gm-Message-State: AEkoouvnkJ6H+9TafYHgRtHYmhnEPxhXsVFZS3FxNI+fG9+mMsUUdQyTSnk71IDBQ9xlPA== X-Received: by 10.36.142.4 with SMTP id h4mr22601956ite.65.1471906894951; Mon, 22 Aug 2016 16:01:34 -0700 (PDT) Received: from localhost.localdomain ([216.16.66.181]) by smtp.gmail.com with ESMTPSA id j63sm357187itj.19.2016.08.22.16.01.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Aug 2016 16:01:34 -0700 (PDT) From: Burt P To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Aug 2016 18:01:20 -0500 Message-Id: <1471906881-10946-3-git-send-email-pburt0@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471906881-10946-1-git-send-email-pburt0@gmail.com> References: <1471906881-10946-1-git-send-email-pburt0@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/3] af_hdcd: check return value of av_frame_copy_props() 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" Anton Khirnov: "[av_frame_copy_props()] potentially contains memory allocation, so the return value needs to be checked." Signed-off-by: Burt P --- libavfilter/af_hdcd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_hdcd.c b/libavfilter/af_hdcd.c index 1bcd279..2324dc3 100644 --- a/libavfilter/af_hdcd.c +++ b/libavfilter/af_hdcd.c @@ -1530,14 +1530,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFrame *out; const int16_t *in_data; int32_t *out_data; - int n, c; + int n, c, result; out = ff_get_audio_buffer(outlink, in->nb_samples); if (!out) { av_frame_free(&in); return AVERROR(ENOMEM); } - av_frame_copy_props(out, in); + result = av_frame_copy_props(out, in); + if (result) { + av_frame_free(&in); + return result; + } out->format = outlink->format; in_data = (int16_t*)in->data[0];