From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 0C71941254 for ; Fri, 26 Aug 2022 15:46:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F112268B9D9; Fri, 26 Aug 2022 18:46:13 +0300 (EEST) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C0F668B8CC for ; Fri, 26 Aug 2022 18:46:07 +0300 (EEST) Received: by mail-pj1-f50.google.com with SMTP id x14-20020a17090a8a8e00b001fb61a71d99so8455013pjn.2 for ; Fri, 26 Aug 2022 08:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandflow-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=0Swbw1LhGAhgCLdXHSZxd9P+W131a4MbNDBf6skg8NA=; b=jAAktlg+WohWkXUm0oYsebVnaSpboPuKbSKFHkGfZ8NhoCqCvoDY/XtJEdX6PwX3lc LKUd8eZHOtRMWeH4Bk/SVKFGhqSNtpG5EJrgKyIARAQWATbX4jmpau/zR747cN2VxbwA wbWAdFmThDZEP27ITFXDK1fP0Svss5C+2pUTnUz/HYj4IX4q9JU0tzZSdw9DfOPPisru K4YXwlmHEW1QzDOxVP+d5+bO5PFxMIiyiws5gXOmfWIHE1KY5QliT6CuKUKEhAiU51hY zZl6JtrBd5tsJIG+qoASoTQtLnvbE+eUKqju199G6hFkRWt2OAgfO35RqMjgA4YVwaHO GFmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=0Swbw1LhGAhgCLdXHSZxd9P+W131a4MbNDBf6skg8NA=; b=Xxb1qb80Fin8BjNp7AvprxjHbMCKgnNcPbNMEfWoMrmxXzAMmTEyw+C90dvNDTWSQN DgPDpk+N5N4HWbS17LRcXIQzYGHqgK57IyE160cE7aZ+KNylUa22P5XLsfWiVDXVRlFI FS8mGKLuElQZFim2/pzodWju0pZpuH/WOgsaAncYOBryABE1+HppXseyuExfS2eW7crT 4ADzzO7W7gCD4kSosS5/FhxJ0d/dQkffd2czbv7cyNqOk+YCjTfrDxXcDdTEnAyUCBOW WvA8GCNLoQgff/dyszBMzPHbGLO+a7tdm9c98NQlYEVvHKQk2geyC7k+ZBprS67jHsdD C3vg== X-Gm-Message-State: ACgBeo0m7g08QH9TXhhNuMonmfZycDmrg2uBHiBpHSbWNYBBR/PQ59Vq 7ZNmrjKy6ZFSnGypUADH/VqD6SRpwvTThQ== X-Google-Smtp-Source: AA6agR5v687YaR3qkShZkweGctWXHIMUH2ZDWh6T964iNYtzEiozl4b/QMwCyq7dbXXw4dhynlc35w== X-Received: by 2002:a17:902:7845:b0:16e:ea31:3354 with SMTP id e5-20020a170902784500b0016eea313354mr4102427pln.17.1661528765568; Fri, 26 Aug 2022 08:46:05 -0700 (PDT) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com. [209.85.216.46]) by smtp.gmail.com with ESMTPSA id f60-20020a17090a704200b001f319e9b9e5sm1824788pjk.16.2022.08.26.08.46.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Aug 2022 08:46:04 -0700 (PDT) Received: by mail-pj1-f46.google.com with SMTP id e19so2015775pju.1 for ; Fri, 26 Aug 2022 08:46:04 -0700 (PDT) X-Received: by 2002:a17:90b:1c8e:b0:1f7:5250:7b44 with SMTP id oo14-20020a17090b1c8e00b001f752507b44mr5023512pjb.212.1661528763708; Fri, 26 Aug 2022 08:46:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pierre-Anthony Lemieux Date: Fri, 26 Aug 2022 08:45:51 -0700 X-Gmail-Original-Message-ID: Message-ID: To: Andreas Rheinhardt Subject: Re: [FFmpeg-devel] [PATCH] avformat/tests/imf: Test ff_imf_parse_cpl_from_xml_dom cleanup on error 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 Cc: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, Aug 26, 2022 at 1:22 AM Andreas Rheinhardt wrote: > > Pierre-Anthony Lemieux: > > On Thu, Aug 25, 2022 at 1:58 PM Andreas Rheinhardt > > wrote: > >> > >> Improves the test; also should fix Coverity issue #1512408. > >> > >> Signed-off-by: Andreas Rheinhardt > >> --- > >> libavformat/tests/imf.c | 10 ++++++---- > >> 1 file changed, 6 insertions(+), 4 deletions(-) > >> > >> diff --git a/libavformat/tests/imf.c b/libavformat/tests/imf.c > >> index e65629ccbc..a7b2ed3b4d 100644 > >> --- a/libavformat/tests/imf.c > >> +++ b/libavformat/tests/imf.c > >> @@ -338,10 +338,9 @@ static int test_cpl_parsing(void) > >> return 0; > >> } > >> > >> -static int test_bad_cpl_parsing(void) > >> +static int test_bad_cpl_parsing(FFIMFCPL **cpl) > >> { > >> xmlDocPtr doc; > >> - FFIMFCPL *cpl; > >> int ret; > >> > >> doc = xmlReadMemory(cpl_bad_doc, strlen(cpl_bad_doc), NULL, NULL, 0); > >> @@ -350,7 +349,7 @@ static int test_bad_cpl_parsing(void) > >> return 1; > >> } > >> > >> - ret = ff_imf_parse_cpl_from_xml_dom(doc, &cpl); > >> + ret = ff_imf_parse_cpl_from_xml_dom(doc, cpl); > >> xmlFreeDoc(doc); > >> if (ret) { > >> printf("CPL parsing failed.\n"); > >> @@ -506,6 +505,7 @@ fail: > >> > >> int main(int argc, char *argv[]) > >> { > >> + FFIMFCPL *cpl; > >> int ret = 0; > >> > >> if (test_cpl_parsing() != 0) > >> @@ -518,8 +518,10 @@ int main(int argc, char *argv[]) > >> ret = 1; > >> > >> printf("#### The following should fail ####\n"); > >> - if (test_bad_cpl_parsing() == 0) > >> + if (test_bad_cpl_parsing(&cpl) == 0) > >> ret = 1; > >> + else if (cpl) > >> + printf("Improper cleanup after failed CPL parsing\n"); > > > > Shouldn't `ret` be set to 1 here as well? > > > > Will do. (When run as part of FATE, the test would nevertheless fail, > because the ref file does not contain the "Improper cleanup" line.) Thanks, and yes. > > >> printf("#### End failing test ####\n"); > >> > >> return ret; > >> -- > >> 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".