From patchwork Fri Aug 26 02:50:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 37501 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp78128pzh; Thu, 25 Aug 2022 19:54:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR73G5jVi3Q4IULRwTQwrX0Lh/U/RMZ3Gn4uwsiboRk5g6Atp//6WDnvWXzEt0HryUAx06wF X-Received: by 2002:a05:6402:3698:b0:446:6a7c:43de with SMTP id ej24-20020a056402369800b004466a7c43demr5194813edb.414.1661482442768; Thu, 25 Aug 2022 19:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661482442; cv=none; d=google.com; s=arc-20160816; b=x1NKOwjrQaxSrO9qsTEWR4HL7FTdQTpI/xyeEng2R53VLO37DeY6zIJ/IvYr8XIksq m58IZsmLoHnkqXjV3EcfuCkSrLskUpCtbsqh7oretuAXc0xlHeV8uNmEc6TQjtinOZQo cJP6XqpLZsjs7c8ibZ2zY9fyKDPO4EbrxnqMnaBZwHN4EsRawM4o+olxlhSYyUL2RzGu oaf1YrHnI0fIgglkh71J1Y1mZJSn0Mqbb8lpwHtdIpBN+aJO7uRgR5/FilEj9M9Waz+d CLYAzIGdAHEyeXdhMzSi6i7O+PLZAO6g45odkHUyqmA2XPiuCVRRAGSZVdNNoRixnqNX Mx2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:mime-version:references :in-reply-to:message-id:date:to:from:delivered-to; bh=mVF5MwDt0TBvlkz3+2C22xJFTO7yZUhSb0tQgFQqcEA=; b=xwgE6PBPEQso1QpP0Ual6VxwMPI89A83kHPrRH5oJomsGXuORQJX/Xi9vCZW50DRU/ XaAfb1IueY7nWmyT6wSnDnMXIvjzGYf4NaNp7guJGWdrNkgjbeOpH6FqYRBz08vbTKJH oq+zA08bDXDWmT4KtQUrBqRDCowFFM6BNtrWd49yMhm6LucUGLV+K3Q3lmg2JnslzHFo JbEoAZqDD2ZZfuKzmQ/OarEml9ymcSDA+ZFSGy4ojmQd/DIYGYPKkJi66mbK4/3RwrwZ yuzFuWGXNaryD8jb6choMyz5mQzGkcyZzQaXy4/ey7mJfAOYyxgFgPCQxfs+Nxu/Ap16 29Ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ht12-20020a170907608c00b0073066a8f85esi516904ejc.686.2022.08.25.19.54.02; Thu, 25 Aug 2022 19:54:02 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE0CA68B9F0; Fri, 26 Aug 2022 05:53:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from bg5.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5C46D68B5CD for ; Fri, 26 Aug 2022 05:53:43 +0300 (EEST) X-QQ-mid: bizesmtp76t1661482224twlmysc9 Received: from localhost ( [103.107.217.224]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 26 Aug 2022 10:50:23 +0800 (CST) X-QQ-SSF: 01100000000000Z0Z000000A0000000 X-QQ-FEAT: fwplPe5ckNLs3ezkha91xUoSD+lWBqIt1kAnwa98XMxx1nRxuyELC2gkSJxPa 7SyjJavIThNExgPlW4PJI+z6jkB0t542bWAzRInj78bofhAZ/XYachQ5pQsbOki27ACOneT QU007hdbURGhnVR1jFLPBtS8Eh2jz+Bii7yfH0QPNFme5sN0uHpTAjwpAWtQ+VVvESwNc2L L5eBlGyRQR4n4UCqZrDTGhZI4O4RIRncBK94Uu59pUq+GZroUHeuRNgpoIuQAsO3A8e8sTb csn6KBjYVORX/iAVJJzgb8uVNKsb4VmDcY9NF2YfLykQL1yO1XCy/RY7omP7nwhDNTr9Xht b5JbCWZ4AETOk24bkfPMGC5nIpjLBeSqF0sql9k X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Fri, 26 Aug 2022 10:50:16 +0800 Message-Id: <20220826025016.29627-2-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220826025016.29627-1-lq@chinaffmpeg.org> References: <20220826025016.29627-1-lq@chinaffmpeg.org> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvr:qybglogicsvr2 Subject: [FFmpeg-devel] [PATCH 2/2] avformat/dashdec: check val before xmlFree it 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: Steven Liu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: lVMpgO6CzI4l fix CID: 1512404 When there have no val value should not xmlFree it. Signed-off-by: Steven Liu --- libavformat/dashdec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 63bf7e96a5..bf9adf2183 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1185,8 +1185,10 @@ static int parse_programinformation(AVFormatContext *s, xmlNodePtr node) } } node = xmlNextElementSibling(node); - xmlFree(val); - val = NULL; + if (val) { + xmlFree(val); + val = NULL; + } } return 0; }