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 D1BCE440F5 for ; Fri, 26 Aug 2022 04:02:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9E3B168BA02; Fri, 26 Aug 2022 07:02:44 +0300 (EEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0C2EE68B58E for ; Fri, 26 Aug 2022 07:02:38 +0300 (EEST) Received: by mail-pl1-f177.google.com with SMTP id v23so547815plo.9 for ; Thu, 25 Aug 2022 21:02:37 -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=RKn+jU3/d1HCy04e3faHviMhpvLcXoopOyxs9zA7XtY=; b=KiynFt9AYg/OsA8cL6fq9+RU9wg9eIUHF8pYO7RjbnnbsYV4EyiA7meun7vEOu4BNn FTqOyP07eAaieqshkcGtcTAfC9xomn03wHAfEqixEm1K0zegyO+x2xJaieAP5v9UybOq kkBxdnta+/KnsUrGtNviNicew8fmcdvP98f2cl5kwsON08aYqKFCnnBw2NSX8yV73LTX VHVdXPsdHjyKwH7dEY8Xpju/M39AFdkEvS8mVSy+Dvjl3+L/2mX2wyN5JhSUE6SgFKIw xxvIhpkbEVLLlrlOUI6rAGTZvoM42+MnJ4TPO2rSXRt3ksLR4+0sxVRgs7VTU8jaNYw+ OGWw== 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=RKn+jU3/d1HCy04e3faHviMhpvLcXoopOyxs9zA7XtY=; b=FVabIIgTROXHlbAmxngiuP/RtdCWXf+RZdH9EoCqFLGhy91Ph722mLni4+QXmCkV7M u1lsY6aT9gN5w2HXtJc+QNWfzMto9gCCNskB+r40zWNMA8LUkHw0DpVhVBtotvplIsjx ie+QDC18cvzEk8eIMznq5PxCF3FKK+0jg5D33CLjSC0qTQLRamKqkjha9Gcy4yR9qiai 9/C5S1XyxypazN0LniJsuZ+MgD7LEnlkwbYVKfnEx1YIDU1RoWlVDHjTaaXVUGNReuoX SdXJ8sU+OO8M3zzS/eSaHP4GDWEoQUdW8ln8xrTTXthnObrVV7sdWX46MqeDIzmxUEru rJAw== X-Gm-Message-State: ACgBeo0ftJKBPcrUuZy8gq6fgW/PraUvDBKU/KKzdT3qUvhF56uPWrlj ivhnmbLflY3TGgS00XWgDbOQaGvBlXldyA== X-Google-Smtp-Source: AA6agR7JoRutQjpYQVXqKz/bRuWuuRL7CobwDHj3C83VOjsRQK/iIl9rXKKcUBCNDhLeLVL90y0HfA== X-Received: by 2002:a17:902:db05:b0:172:f759:f99d with SMTP id m5-20020a170902db0500b00172f759f99dmr2081269plx.76.1661486553809; Thu, 25 Aug 2022 21:02:33 -0700 (PDT) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com. [209.85.215.179]) by smtp.gmail.com with ESMTPSA id y125-20020a626483000000b005368fcfb7f8sm460674pfb.89.2022.08.25.21.02.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 21:02:32 -0700 (PDT) Received: by mail-pg1-f179.google.com with SMTP id r69so343357pgr.2 for ; Thu, 25 Aug 2022 21:02:32 -0700 (PDT) X-Received: by 2002:a62:be0d:0:b0:535:df64:b106 with SMTP id l13-20020a62be0d000000b00535df64b106mr2125134pff.60.1661486551954; Thu, 25 Aug 2022 21:02:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pierre-Anthony Lemieux Date: Thu, 25 Aug 2022 21:02:20 -0700 X-Gmail-Original-Message-ID: Message-ID: To: FFmpeg development discussions and patches 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: Andreas Rheinhardt 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 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? > 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". _______________________________________________ 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".