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 8EF7742541 for ; Wed, 5 Jan 2022 02:42:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AAD5968A948; Wed, 5 Jan 2022 04:42:47 +0200 (EET) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A214E68A921 for ; Wed, 5 Jan 2022 04:42:41 +0200 (EET) Received: by mail-pj1-f53.google.com with SMTP id c14-20020a17090a674e00b001b31e16749cso409710pjm.4 for ; Tue, 04 Jan 2022 18:42:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ltf90Z2v+m4a8xLS55Ru1Y4ubf5xMWVuGBZGuN9hPSE=; b=wx6h58fRAItwSmpsgSXJYLkAik6oSSSNEb71zxKxWfPU2dOBeI466j2QhDcEwy5OjK MdL1piIOXSXTLwss4vWIsrKXlaehrEOJydqZnMcnViop6IjetKjSKryLeJ4vCcvAi7b8 pFvihOR88nCmc/ZUePYMXSYm8YblKGfVOej/nDmM8N1UakPqnXw8NBt2M8YCKVFXEp6h 63AjzuwIy/9oPjzfk/cTocBg4/LYT58Fg7MwQ7ZqMZUSRbpiOGMh1+XXbYqqWzZFzRoO 4dFyLkrz/uKMnNF1c2FODoUtpAtfIeRAsTvLkel3jjkQhg8voCNt0mmSIHnuS28Ij1DJ QtkA== X-Gm-Message-State: AOAM532ij3XW9SWbWBTizBwj6tG9jwMawNCdEhSG4VfglKdqi72pHy45 BSSOvqzMh2jahMw4J2VC7FI4TAg/Yo0= X-Google-Smtp-Source: ABdhPJyIVQR9hdb+UL04AkIg/qeGFjenZx1Q5GnXjTxScXqp0+p3KB3JDneXPSV9APAdCIJjY/sJ4g== X-Received: by 2002:a17:902:a509:b0:143:7eb6:c953 with SMTP id s9-20020a170902a50900b001437eb6c953mr52107682plq.4.1641350559722; Tue, 04 Jan 2022 18:42:39 -0800 (PST) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id e24sm590561pjt.45.2022.01.04.18.42.38 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jan 2022 18:42:39 -0800 (PST) Received: by localhost (sSMTP sendmail emulation); Tue, 04 Jan 2022 18:42:36 -0800 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jan 2022 18:42:06 -0800 Message-Id: <20220105024207.27508-1-pal@sandflow.com> X-Mailer: git-send-email 2.34.1.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/2] avformat/imf: fix CPL parsing error handling 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: Pierre-Anthony Lemieux 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: From: Pierre-Anthony Lemieux Signed-off-by: Pierre-Anthony Lemieux --- libavformat/imf_cpl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c index 7055b49ae8..f49469f56e 100644 --- a/libavformat/imf_cpl.c +++ b/libavformat/imf_cpl.c @@ -807,7 +807,9 @@ int ff_imf_parse_cpl(AVIOContext *in, FFIMFCPL **cpl) av_log(NULL, AV_LOG_ERROR, "Cannot read IMF CPL\n"); if (ret == 0) ret = AVERROR_INVALIDDATA; - } else { + goto clean_up; + } + LIBXML_TEST_VERSION filesize = buf.len; @@ -817,6 +819,7 @@ int ff_imf_parse_cpl(AVIOContext *in, FFIMFCPL **cpl) AV_LOG_ERROR, "XML parsing failed when reading the IMF CPL\n"); ret = AVERROR_INVALIDDATA; + goto clean_up; } if ((ret = ff_imf_parse_cpl_from_xml_dom(doc, cpl))) { @@ -833,8 +836,8 @@ int ff_imf_parse_cpl(AVIOContext *in, FFIMFCPL **cpl) } xmlFreeDoc(doc); - } +clean_up: av_bprint_finalize(&buf, NULL); return ret; -- 2.17.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".