From patchwork Mon Jun 22 15:24:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 20557 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9C1E744BD1A for ; Mon, 22 Jun 2020 18:32:09 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8710F68B90A; Mon, 22 Jun 2020 18:32:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0B1468B8FE for ; Mon, 22 Jun 2020 18:32:02 +0300 (EEST) Received: by mail-pj1-f68.google.com with SMTP id u14so2235pjj.2 for ; Mon, 22 Jun 2020 08:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=s9SH0bSve2b+wbv4baONnUem4dbJYlxon+SLOK9IgWA=; b=pYMqkBKyo9wCFwe1mf+9T+QEUBJt+S8o0tJR6H7/mhUuBb0oZ3GpJhB7oT5YICgP9l Fgc7VlYHNJ9T6skONbqk2zNuaaeZ2vR8KfVWYliiupSfkVJsopq3feipXoP1Kl4N42+c /2PWkw46O94SnIAzANG488ZDhzMbZOjIt+Y22DEiFYK7cAGvPAnSqloTzl58pinjCMJ3 SPnzXH8tSQOEcJWRp2gSjJpvugcDkxZsMzwOTa9VB5Uw6NucliyrQpf+hIFmz/uJcK1e iQ8oEEA/kq1w99hHBQRTNURVInGZC0Mrj2ZrMRiW2kdbYJeilx9iaCyQGMY4NglzN/N6 mniA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=s9SH0bSve2b+wbv4baONnUem4dbJYlxon+SLOK9IgWA=; b=KuxwN5Xm9Wy5COf+lM2V12wpYs7SW5bHtQ/vEnARnKpmS5tGyzN+L52S718zrpC25k +h/kijlyU0JiAvK3LZl8xQQMua3/wI/Scx9EMtTr5CS5P93r1EqDiwMGHXtVGOR3FLrQ WOyz3k1VR94krEwuWHrSHHieYE4eEWDzb4nzFnszyPnGLSsX+hgSbYHHjAN4Jvl+gtGQ KBu4/m72Xb3J4jb4Wmz0DpRWBZLVEDzgg0uxP3utWd541TcgiS4ElzYvNBNpQsk21NwJ 0910R8wPxlsQlVpkz7hsnqAlKG2EMPdfVwXIvPKjUQPDFPh2EJmR3JM8znJYdnKx2dHF Di2w== X-Gm-Message-State: AOAM5327qHdkX8pHWK61Do0cXOKVl1f9QQKXjzh3nUeNWkjxOUjdIcdG Ikzc6jcB79eEGGQ/kNgyIE3duM8q X-Google-Smtp-Source: ABdhPJzqyI/H0RrHl0X8PMyJh8ZlJOgsK+A0GyOf4bMuNx6q2fsu+qnAVtH//6byPT5w0OvdVhOxgQ== X-Received: by 2002:a62:18d0:: with SMTP id 199mr21389738pfy.101.1592839483696; Mon, 22 Jun 2020 08:24:43 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id n1sm14212314pjn.24.2020.06.22.08.24.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2020 08:24:42 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Jun 2020 23:24:29 +0800 Message-Id: <1592839474-2804-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH 1/6] avutil/opt: check return value of av_bprint_finalize() 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavutil/opt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 2c3f998..552985e 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -2120,6 +2120,9 @@ int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer, av_freep(&buf); } } - av_bprint_finalize(&bprint, buffer); + ret = av_bprint_finalize(&bprint, buffer); + if (ret < 0) + return ret; + return 0; }