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 E300B4251E for ; Wed, 5 Jan 2022 00:58:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7DCF768A72F; Wed, 5 Jan 2022 02:58:13 +0200 (EET) Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B2D18689B39 for ; Wed, 5 Jan 2022 02:58:06 +0200 (EET) Message-ID: <06b93b03-022b-4685-690d-5cda0dba9544@zanevaniperen.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1641344286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=reZSM9TyK1WNUnGuh9nhyloBSNLbg+58ADUATWRiVaU=; b=b2YF1GC1m2C1u4PylewRfpRMA0ffC98/a/1aI1k9a0sGlBxbNzpaQB2nXmXYwXy87oubEU QlGK/Hz5o3ssNpufLoYsr9nbY4jOSDKOhMFg1ckKSl/vBx7NDyHws+SZt7PZ9BTDzUa1V6 2jx4WFmMwrk6ATjjtCZkTuwMZ+JleQ0CPhou3AqQlm58qOth2+rhPtPjSrAzP5cEUHkjq3 GCWVQNa1aNKdP5DnLTfE/RMN/vTL3eqbZ+54YGKpFqnLGiDkDrSllo8VJXxM7ECw6bHZHe 5uSE9x0a2EsWItM7F9r2s8hvdkqydVpi3Z/IQ9BBbfQcSJ7aqdLPet6ro7aTGg== Date: Wed, 5 Jan 2022 10:58:02 +1000 MIME-Version: 1.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220104061056.32737-1-pal@sandflow.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zane van Iperen In-Reply-To: <20220104061056.32737-1-pal@sandflow.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: zanevaniperen.com Subject: Re: [FFmpeg-devel] [PATCH v1] 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 4/1/22 16:10, pal@sandflow.com wrote: > From: Pierre-Anthony Lemieux > > Signed-off-by: Pierre-Anthony Lemieux > --- > libavformat/imf_cpl.c | 51 +++++++++++++++++++++++-------------------- > 1 file changed, 27 insertions(+), 24 deletions(-) Could you please resend this as two separate commits? One with the change, one with the re-indenting? It makes it easier to review (and bisect) in the future. For reference, the effective change is: diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c index 28798d3e36..366a1be9e2 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; > + av_log(NULL, > + AV_LOG_INFO, > + "IMF CPL Id: " FF_IMF_UUID_FORMAT "\n", > + UID_ARG((*cpl)->id_uuid)); > + } > + > + xmlFreeDoc(doc); > + Trailing whitespace here. _______________________________________________ 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".