From patchwork Fri Sep 13 16:30:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vectronic X-Patchwork-Id: 15060 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D72C8447EFE for ; Fri, 13 Sep 2019 19:36:07 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AD50A6881B8; Fri, 13 Sep 2019 19:36:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CEC8E687F09 for ; Fri, 13 Sep 2019 19:36:00 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id a11so22973516wrx.1 for ; Fri, 13 Sep 2019 09:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ex/1JBQ4GDswUHNksytpFkl5zfg6E6Rr3kU02izq3u4=; b=PSMv8pR4MVKOhBMesFOhjgM4fOlKwGEwHWO6oK66QwNytTsa82dFk+JyZuAvsWi/lR /tnqELNa66AMGcB4iEfHdVrEW3M9pygcrXFw3Con/3ufVMToe/Bdrsd38J6vPCe7BdnI BscKX+V2J87Y4q3UgPnVcsz7ayutcTNiYEermR5iXL3fYbK2OCsHPGyALWXAhNd+J3Ez jQH3UIy1ufZyhCKVBDrqhRNHHDH9JYzae9SmITKw/BcgouykHYcy4/8G5bmxMgbHYs/l BqMPgDxJeE33xwIThjbiYGs0J3dCNKnzhKWqc3lk3xGkuabjiBIsi80hcou9NHm8rt75 PJ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ex/1JBQ4GDswUHNksytpFkl5zfg6E6Rr3kU02izq3u4=; b=s3ZuqysrHn16vbELRBRKB+4WgMgjtfZuoztdtuKYU/VOkkAbtVopnqixyGRJHx+eox aJ7w9W4DG/Bs25gfnrVQUPKdSoHJ/TkIDm4EHNXNWpLMfwMNNRqqX60Y4yfDLrtc13QU nQbqJMExCL67e+qjelmTr6ThGxNj4DQ92bKKdldBOHgbK3cKV9Lqrg5qXNTWK6y+vot4 FaMMUocmcG1W1IpUnJZWtEHpoOymXE2fVOowGFZBobstw+l+s5dwcawS7EooIP2STPdp LHLkVtdG0VuwxqvkBR+RSDjRMjMJlWN4mbtZMybRzzOxTXzpiRTjas+2ZVcUwWGp1Cuu 6v7Q== X-Gm-Message-State: APjAAAVz+n+ZUVWmQrW8qDrY8g+sgNJZHVUXC3DnQ6wYf3dYMUTB2p36 emKQdNu5ihrizimGsMxUAc5nC7a0n30= X-Google-Smtp-Source: APXvYqzLBmqRARuJjWPV4fzbLllH5imxSnCPzuU3W71Pzh1tp/mmksWaUbvLb1TKPli6lDJ01Pbrpg== X-Received: by 2002:a5d:6846:: with SMTP id o6mr2540823wrw.73.1568392221345; Fri, 13 Sep 2019 09:30:21 -0700 (PDT) Received: from localhost.localdomain (78-32-249-178.static.enta.net. [78.32.249.178]) by smtp.gmail.com with ESMTPSA id n4sm3073020wmd.45.2019.09.13.09.30.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Sep 2019 09:30:20 -0700 (PDT) From: vectronic To: ffmpeg-devel@ffmpeg.org Date: Fri, 13 Sep 2019 17:30:12 +0100 Message-Id: <20190913163012.91715-1-hello.vectronic@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/dashdec: fix pointer being freed was not allocated X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: vectronic Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" prevent attempt to call xmlFree if val was not allocated fixes: 8135 Signed-off-by: vectronic --- libavformat/dashdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 4f725ba09a..8022ba9afe 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1185,6 +1185,7 @@ static int parse_programinformation(AVFormatContext *s, xmlNodePtr node) node = xmlFirstElementChild(node); while (node) { + val = NULL; if (!av_strcasecmp(node->name, "Title")) { val = xmlNodeGetContent(node); if (val) { @@ -1202,7 +1203,9 @@ static int parse_programinformation(AVFormatContext *s, xmlNodePtr node) } } node = xmlNextElementSibling(node); - xmlFree(val); + if (val) { + xmlFree(val); + } } return 0; }