From patchwork Thu May 20 21:25:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 27847 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp2810360iof; Thu, 20 May 2021 14:32:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcATcWPweFR86aBWro5Afe/Xd/X7KGv8B48OQaBWIxmCTO7txvJkCd8+b2E5uVbt6aNwUw X-Received: by 2002:a17:906:318b:: with SMTP id 11mr6439790ejy.395.1621546355462; Thu, 20 May 2021 14:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621546355; cv=none; d=google.com; s=arc-20160816; b=HJQvne75MjHgnxohsFZGpeBAY3C8ePqvtmWZasokw4N9NNkOFFTJIHruPBKiuysKQY /aI8Oo8TPu+FXiuU5GDcUBAZbZ1OvwwhR4eoehmL8EWMOPIpxbJoO9KAzUxXGlfRGPBI IJkDHK7EOU2tCKQg8kNrDio8dTupnxK0YC7r38UE8dIiyxRbecUhX2gmAKBPREXIv0O3 QsWGgjfz6THX6fAveLu+0fW9Ks5TQfQOYpywBFCHLi4FPwmXqFclUgOdi09HePOd03LS 6pR7a5aVN24gII/mGgtNhvST7gx4qwC2B0YsnJLuUSSh0GqMeyXrQo8oQt6+b3FMUqWc zhcA== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=07064Hcg6t+RzPfYa4P8OxdsaCFv82LGOMe9+qoZvRo=; b=GlL91UdvvYyDOvo3Ht+CJvy2za9Fcg2tIpEh0wQzy4fA3Bju1ih+A1qtOQSLPcTdlO WxwSQmHGIZIG/n4CfRsGFfXvLpqmkkAWHiHm/1LqEza1dM5MuD1mMtuM44xn6l/G7u70 UhqdoOzz75SY0Aiw0FzMKivDhwP05Nfv8qBnHRMiakVXKUHcl9EbzxdagE8NN+Xqvpw/ 2AHm8gUDfJm7loh0+5zCIyKtZCfqEP/S37+4rDJocrKPZm/tsb7RygkmcAQGl+j1VncM y/We9ZBRcwkZX8Fq26eC6HjkeerU2BopKPs35HD82oIAABSdwh9XFQfaYRPrkX0VjsPL ITEw== 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 s20si3720483eja.135.2021.05.20.14.32.35; Thu, 20 May 2021 14:32:35 -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 BC556680BE0; Fri, 21 May 2021 00:32:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-1.mx.upcmail.net (vie01a-dmta-pe06-1.mx.upcmail.net [84.116.36.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D8632680BE0 for ; Fri, 21 May 2021 00:32:23 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1ljqBu-009QWj-0H for ffmpeg-devel@ffmpeg.org; Thu, 20 May 2021 23:26:50 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id jqAwlAblxljeHjqAwlB0rT; Thu, 20 May 2021 23:25:50 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=BoHjPrf5 c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=I7hKg_iGLXIzsgj-r98A:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 20 May 2021 23:25:49 +0200 Message-Id: <20210520212549.15466-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210520212549.15466-1-michael@niedermayer.cc> References: <20210520212549.15466-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfOwP3nA6oJVkwTCOj/FrR2u1vBA6XHKIGMwib2RpTePedoEWyxNlnfkLlbUZLOXdTKKp8KxFsT8g0zq6cOCqzB4IMXeRlj20rhYviJzWNJw+1b8HB+9u Rtf+dxiiwDSPNvpSvbHOptScCcxZa7QmqEwy58NBaql3jhxYNlkbTQAh Subject: [FFmpeg-devel] [PATCH 3/3] avformat/avio: Check av_opt_copy() for failure X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: ZbtiWwVvvXAk Fixes: CID1477416 Unchecked return value Signed-off-by: Michael Niedermayer --- libavformat/avio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index 2974f4b2b4..6be6f9bf97 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -313,8 +313,11 @@ int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, int ret = ffurl_alloc(puc, filename, flags, int_cb); if (ret < 0) return ret; - if (parent) - av_opt_copy(*puc, parent); + if (parent) { + ret = av_opt_copy(*puc, parent); + if (ret < 0) + goto fail; + } if (options && (ret = av_opt_set_dict(*puc, options)) < 0) goto fail;