From patchwork Sun Oct 7 21:02:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 10566 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:ab0:73d2:0:0:0:0:0 with SMTP id m18csp2888446uaq; Sun, 7 Oct 2018 14:02:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV62yH75EBbskKP4Yk9ZLt4YlVDRTvPOnmE5zHUK8rPfDcMjkaL9J63MTFUzdeyvq8dCN+9cC X-Received: by 2002:a1c:a851:: with SMTP id r78-v6mr13251141wme.97.1538946172016; Sun, 07 Oct 2018 14:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538946171; cv=none; d=google.com; s=arc-20160816; b=e7LS4+hSSPaoSb+y3aZFaTYiuj/RN/uP8hiWG+pqEg0Rxk/Wbl1x1o4WjemK+AJ8ft /N+K4LP23sIR8SyLsSalxRclkGm7VQ7I/aCI94TsQ7zeLLY3AkX0zkxErTXNTX8czwtd WPi5ZZ1J8LdsT9IgwygTr0/Vzu61Yp8KaoLPc+RemEx9KvloQeVyGITx85jIbJobHG91 Rko/m4WnudUTo5VM6m9jUngUo3Pn2o9EyqQi/TIuCcQ1tSoXKmFn6+oVzKIIK+qP+5cv 9FOWJItp0RwmR1K+6GczhtnG/zoTOLizBcOrCQjIYtQoU6uhnUNu0sLSgNJBjabmZE+X X7oA== 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=H1gv9SpyipJY5NZtYaJb6L4qWPQscpVaMQPSvwuTds4=; b=jqgDjASGGBq3eKpaeHfHiMyMWZunGqqwMtRgaARUm39MBaIXQyLAaUfxiAusKcxxqT r2TKXG+2Siq8UEDdmwabs1ELyUHiX63HHIONOQxx7+nM28jY7FLGX+ezoTygs2YNd+e5 4UWYP/5w6Bb+UdYptMAThPMPbvLbm/6YL2cffH2aJaCLdBAPq2PVSdOhjmNa2gX+h/xY 3h1bZDAYVQiYoYgpbNq5LIEb82OMdWRnJXtuJYLQB3NIAeHAeF3iOT91Uhytc4SK02Sn 4kn/vmx4fKBSTN2KaX8rbDWRJnEstdwq8ARKgO4FWCPkZBtf7xnOAvU/wlgOjYRtbjDj jvvg== 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 d17-v6si11046588wrs.188.2018.10.07.14.02.51; Sun, 07 Oct 2018 14:02:51 -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 393BF68A0C6; Mon, 8 Oct 2018 00:02:24 +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 46F5F689F9F for ; Mon, 8 Oct 2018 00:02:17 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DAA97E19C6; Sun, 7 Oct 2018 23:02:38 +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 4VSTL8hMusoX; Sun, 7 Oct 2018 23:02:38 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B21D1E19BF; Sun, 7 Oct 2018 23:02:36 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 7 Oct 2018 23:02:27 +0200 Message-Id: <20181007210228.16822-2-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 2/3] ffmpeg: check return value of avcodec_parameters_from_context 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 1427273. Signed-off-by: Marton Balint --- fftools/ffmpeg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 934dc71a74..aa495b5d9e 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3072,7 +3072,13 @@ static int init_output_stream_streamcopy(OutputStream *ost) "Error setting up codec context options.\n"); return ret; } - avcodec_parameters_from_context(par_src, ost->enc_ctx); + + ret = avcodec_parameters_from_context(par_src, ost->enc_ctx); + if (ret < 0) { + av_log(NULL, AV_LOG_FATAL, + "Error getting reference codec parameters.\n"); + return ret; + } if (!codec_tag) { unsigned int codec_tag_tmp;