From patchwork Sun Oct 7 21:02:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 10552 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:ab0:73d2:0:0:0:0:0 with SMTP id m18csp2888547uaq; Sun, 7 Oct 2018 14:02:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV62U3j30LcJLm1kLyo9/kTU1oINg9vIfCLbK8TU0amW6DCd3ZeQh7A8v3MTl4INnfP+KRmDj X-Received: by 2002:a5d:6785:: with SMTP id v5-v6mr14054937wru.245.1538946179115; Sun, 07 Oct 2018 14:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538946179; cv=none; d=google.com; s=arc-20160816; b=iHg/FtfOg4TWwbTp7pr6kv/TyPnyTZrHf/M9SE67QLpTdb/ZELAiuJ2p06sxG/K6Za D8RuTN6QfTcgvUwzfLmhhHetErF89IezyMjVubggpvQEf4qpgaLsnR4YFIMhKS6ZnO1G eed3lyyi2sTKcqVdH2cpsnBm83jv1KfueROFXcpZxVBULkrUr8Wk4QOflCL/c5PPKjBm BVNmuJival72mlBvFTVvEr3FraJya6Be5cU9sRSXJm3tQeG/BtnmbZP5nfWqagzBMw4i fyGpo+TgVjoiGkHnQ5dHPUxSi/0SyKqDOy4ANsn9jvEr/NuaUtAGzp05Nh80/2xIxv/S 6KwA== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=YNO9hhAz4RxEck9fAV0CA83WZ+LkYTAMg+BltA3Sq3E=; b=sWvSRWX5Tvbq81fcLV12u9ltdrv8jsHpSggyeUidMp6IgO4VQdY+aLoUF7m9wIMHLz VLb5mNbmVP4D8nbWsxnKGSSQLXCcIJf8zSKp4/xG/Ag4FPoYkIuTPjPGFW6GviWMTDHG EyiTx6jqIjoVsUb4h9ylNZZZnQrgVrr5P4IaztS1jnPEaekpDq2WspbhNU6E5grP5yg6 R5RIe19fSpRMU0hUKZuyyU+1vyBNmaT4s4LfaXbiUEGi0RFFkS2EBYxtUKABH8VhnGX0 qCXB+OXhrj0IelpRmbo0M1WwHY7RluGrwa41WUSVj99FTHne2m8Au5bFyEhL1pIrSPG0 8t5Q== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d17si12105128wrx.293.2018.10.07.14.02.58; Sun, 07 Oct 2018 14:02:59 -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; 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 3175C68A0C7; Mon, 8 Oct 2018 00:02:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8BFB3689F35 for ; Mon, 8 Oct 2018 00:02:18 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2D047E19C7; Sun, 7 Oct 2018 23:02:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BgJ8zpIJNUJB; Sun, 7 Oct 2018 23:02:39 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 503D9E195A; Sun, 7 Oct 2018 23:02:39 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 7 Oct 2018 23:02:28 +0200 Message-Id: <20181007210228.16822-3-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181007210228.16822-1-cus@passwd.hu> References: <20181007210228.16822-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 3/3] avfilter/af_asetnsamples: do not leak frame on ENOMEM 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes Coverity CID 1416352. Signed-off-by: Marton Balint --- libavfilter/af_asetnsamples.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c index 30fabede26..e8daec8d8f 100644 --- a/libavfilter/af_asetnsamples.c +++ b/libavfilter/af_asetnsamples.c @@ -71,8 +71,10 @@ static int activate(AVFilterContext *ctx) return ff_filter_frame(outlink, frame); pad_frame = ff_get_audio_buffer(outlink, s->nb_out_samples); - if (!pad_frame) + if (!pad_frame) { + av_frame_free(&frame); return AVERROR(ENOMEM); + } av_samples_copy(pad_frame->extended_data, frame->extended_data, 0, 0, frame->nb_samples, frame->channels, frame->format);