From patchwork Thu Aug 25 23:14:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vittorio Giovara X-Patchwork-Id: 300 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp56395vsd; Thu, 25 Aug 2016 16:33:06 -0700 (PDT) X-Received: by 10.194.221.202 with SMTP id qg10mr139432wjc.180.1472167986042; Thu, 25 Aug 2016 16:33:06 -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 rb4si16112180wjb.208.2016.08.25.16.33.05; Thu, 25 Aug 2016 16:33:06 -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 B4755689AEE; Fri, 26 Aug 2016 02:32:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B656687EE5 for ; Fri, 26 Aug 2016 02:32:51 +0300 (EEST) Received: by mail-qt0-f196.google.com with SMTP id u25so2340092qtb.3 for ; Thu, 25 Aug 2016 16:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=Eb+Red16yMQBdU7RwGrlhzdCurt4wdsLTOfVWux2Ghg=; b=kbmZyNcYeirxg94+LH67vbYLB+zIb4e2+xZahRkAAfqx7UjmEBvLzxJGhTxZcfpouk FGTUCo66hymgJA1Byk/7sxeOLS+vP7sKYLsO/vUe76a7iYMp1fI3L8v3zhlrhnly4xF3 yRHZGPO16TagtbCd97+cTJ8OYx+sUAk+NOOa8zJVgKy7ENrEZDgJMn1a1eJM9O9WzSeu kp102ZHf89o0JuCb/jKiSL26FxlxTlcJGCA1SuFwNn5clh7llbCJqcWno6AdQBCaOGv/ 2xYVJGRcP+e4Mn2Xt/1vbPRQdkxk5dtwPU+W+vTFV3td7EY+SmP/SFSl9Xij7PqQ3MgO riCg== 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; bh=Eb+Red16yMQBdU7RwGrlhzdCurt4wdsLTOfVWux2Ghg=; b=OMFIfd90bhe/gQSeaiHvyWsFYPbv35DdLer880K+hKrXjMApkU5XPIiXTjXCul+enc DgqEqbvef0djAP93II3CV/SkRzOHDZ/v+knX50WS2XXIoXpJG4oJDD5LswyqnhN/dPoq oxw7WAWezzPM2Rlg7aKyrGnPzUNKbMkCt2NOCDUhJlMsb/6d8Q1bvrR2jBjuv2coo/qW kI5sG+6OcvDF4+i5zdeqQIwk/IiDQdmqoAPGqzCGZGCaX9BYuPc9qhgW4IJ4HEOa+qON Ok38bOlfA4n6V2vlYQM++2vKfjzCxTVgIJAt4E464INUnWxLqGkx5HmGzpRd0jhitYRh 4mPA== X-Gm-Message-State: AE9vXwMwOdjhMQ72WwzMqbQwRzYjk9YqxN7wz1RO24oEA7JSn24VLIAnQ60v08+A0lXDzQ== X-Received: by 10.200.50.20 with SMTP id x20mr108203qta.71.1472166901048; Thu, 25 Aug 2016 16:15:01 -0700 (PDT) Received: from vimacbookpro.vimeo.iac.corp ([216.112.253.9]) by smtp.gmail.com with ESMTPSA id l32sm8866834qta.23.2016.08.25.16.14.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Aug 2016 16:15:00 -0700 (PDT) From: Vittorio Giovara To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Aug 2016 19:14:57 -0400 Message-Id: <20160825231459.15314-1-vittorio.giovara@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [FFmpeg-devel] [PATCH 1/3] vf_colorspace: Check av_frame_copy_props() return value 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 function can potentially allocate memory. --- Please keep me in CC. Vittorio libavfilter/vf_colorspace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c index 3d39f13..bf51c83 100644 --- a/libavfilter/vf_colorspace.c +++ b/libavfilter/vf_colorspace.c @@ -861,7 +861,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) av_frame_free(&in); return AVERROR(ENOMEM); } - av_frame_copy_props(out, in); + res = av_frame_copy_props(out, in); + if (res < 0) { + av_frame_free(&in); + return res; + } out->color_primaries = s->user_prm == AVCOL_PRI_UNSPECIFIED ? default_prm[FFMIN(s->user_all, CS_NB)] : s->user_prm;