From patchwork Fri Sep 1 10:26:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 4935 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp512950jao; Fri, 1 Sep 2017 03:26:56 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4VT/dXMEOVZFWTMoNAGpykVw4DSBjZCPsne6YnNORVNu60YuGLjzpoCrmKW1APMz0l5VZq X-Received: by 10.28.93.84 with SMTP id r81mr126210wmb.43.1504261616684; Fri, 01 Sep 2017 03:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504261616; cv=none; d=google.com; s=arc-20160816; b=U0mdQIFcJjVPTEcaSgrLBvIzZO64tg+G5BKnUyJGy+/hTF1GhR8bLosqeaWGvHduwb eEgRFdnoNGw7wx715LzZMXDeUA9+YzRM+1LT+fthmZhRCeP23GjP/oBiRftajyuIHzqu iFHqof6FYKJcaiaG5NYR3VZpvkCuVpsKREcmdOozEZnUNngQ+7KwZhocq3AxKk5Rbluw Sr16JigrS4zFBp9UeNS+bBoJTia5a+iVU6y+JaHb6R3MdLDSKOKIlBPoRuiUtr9C++aT 0Wy9eFfEGXDs1gG2cFKrUC4GL4mmRZPM9ztajr+zNCQUl0goSO3X0FPtGfjhw5csNeA7 8dOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=V47IrMk3U7beHSDm0rKQvxyU8uZRwdBjIlXdgCUGsgI=; b=t2d0S6C5v78F0O1AHk54vlBLqYkow/Arc/tDbXtWJIVxyKqyMZE0RklhvH7SH9uXdM uUMwHAZHb/Pf4JjDpQiZs3ls2FmWaeq4hWq2mHVNEZyH3pq2Kq1tSDF/9d6ES8T1QqYu jnCs8z5kqXrt/1ASGDdSONg9MhRWXZCAkYV6E1aZ5toIxYBh3LWhH/gHelKLjz7vsj01 kKiy6P83NZl5BkF57NVDfTEGx7c32aFQTkxFTjeKSaeUYzSDYYoBYGU5NNQNylJ6oh9R npPRDBbSUy0k8th2JfREu9DR0tGqUy9GYS5UOt5NDrQEgjih9q5eLqy0EwLrTmmnRNge 20rQ== 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 t84si1861654wmt.37.2017.09.01.03.26.56; Fri, 01 Sep 2017 03:26:56 -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 78E7C68A2BD; Fri, 1 Sep 2017 13:26:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpproxy19.qq.com (smtpproxy19.qq.com [184.105.206.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4DC9068A08A for ; Fri, 1 Sep 2017 13:26:52 +0300 (EEST) X-QQ-mid: bizesmtp14t1504261604tybmmdcp Received: from localhost (unknown [47.90.47.25]) by esmtp4.qq.com (ESMTP) with id ; Fri, 01 Sep 2017 18:26:43 +0800 (CST) X-QQ-SSF: 01100000004000F0FH60000O0000000 X-QQ-FEAT: hovmsYDW+aV1lku380siHl5/MQorl/nhc5o05VYyxAhusVjaiH0Gjx059tqny KvtMaC5GN6H1odHV1yXQqedO5OdExNEqPriwmBCqxKW1j8OWkrzPFbQmKBBor6el/cRVt1W bEwcReHfqBDAn7SUbvFHJt/8EJp1MRqLQk3drR9rt0ySq4VsPyIMmCL4E6UeLF3YJ+x+FvC NFeAqLa1LbOzKDVRJPVqHSxkKqVxdbMWNpbti79E/ckk2M0QYFiTn44pFpQvBDSGItuPAwK JpEdETkP0Cf/lgpuik4NlK2hY= X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Fri, 1 Sep 2017 18:26:35 +0800 Message-Id: <20170901102635.21851-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1.382.ga23ca1b.dirty In-Reply-To: <20170901103330.4988e77c@debian> References: <20170901103330.4988e77c@debian> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v23 2/2] avformat/dashdec: free resource allocated by xml 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: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" modify from av_free to xmlFree Signed-off-by: Steven Liu --- libavformat/dashdec.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 9a3a199d4e..f63f1fffbd 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -440,7 +440,7 @@ static char *get_content_url(xmlNodePtr *baseurl_nodes, memset(tmp_str_2, 0, sizeof(tmp_str_2)); ff_make_absolute_url(tmp_str_2, MAX_URL_SIZE, tmp_str, text); av_strlcpy(tmp_str, tmp_str_2, sizeof(tmp_str)); - av_free(text); + xmlFree(text); } } } @@ -515,7 +515,7 @@ static enum AVMediaType get_content_type(xmlNodePtr node) } else if (av_stristr((const char *)val, "audio")) { type = AVMEDIA_TYPE_AUDIO; } - av_free(val); + xmlFree(val); } } } @@ -536,7 +536,7 @@ static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati if (initialization_val) { rep->init_section = av_mallocz(sizeof(struct fragment)); if (!rep->init_section) { - av_free(initialization_val); + xmlFree(initialization_val); return AVERROR(ENOMEM); } rep->init_section->url = get_content_url(baseurl_nodes, 4, @@ -545,18 +545,18 @@ static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati initialization_val); if (!rep->init_section->url) { av_free(rep->init_section); - av_free(initialization_val); + xmlFree(initialization_val); return AVERROR(ENOMEM); } rep->init_section->size = -1; - av_free(initialization_val); + xmlFree(initialization_val); } } else if (!av_strcasecmp(fragmenturl_node->name, (const char *)"SegmentURL")) { media_val = xmlGetProp(fragmenturl_node, "media"); if (media_val) { struct fragment *seg = av_mallocz(sizeof(struct fragment)); if (!seg) { - av_free(media_val); + xmlFree(media_val); return AVERROR(ENOMEM); } seg->url = get_content_url(baseurl_nodes, 4, @@ -565,12 +565,12 @@ static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati media_val); if (!seg->url) { av_free(seg); - av_free(media_val); + xmlFree(media_val); return AVERROR(ENOMEM); } seg->size = -1; dynarray_add(&rep->fragments, &rep->n_fragments, seg); - av_free(media_val); + xmlFree(media_val); } } @@ -605,7 +605,7 @@ static int parse_manifest_segmenttimeline(AVFormatContext *s, struct representat tml->duration = (int64_t)strtoll(val, NULL, 10); } attr = attr->next; - av_free(val); + xmlFree(val); } dynarray_add(&rep->timelines, &rep->n_timelines, tml); } @@ -699,29 +699,29 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, goto end; } rep->init_section->size = -1; - av_free(initialization_val); + xmlFree(initialization_val); } if (media_val) { rep->url_template = get_content_url(baseurl_nodes, 4, rep_id_val, rep_bandwidth_val, media_val); - av_free(media_val); + xmlFree(media_val); } if (presentation_timeoffset_val) { rep->presentation_timeoffset = (int64_t) strtoll(presentation_timeoffset_val, NULL, 10); - av_free(presentation_timeoffset_val); + xmlFree(presentation_timeoffset_val); } if (duration_val) { rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 10); - av_free(duration_val); + xmlFree(duration_val); } if (timescale_val) { rep->fragment_timescale = (int64_t) strtoll(timescale_val, NULL, 10); - av_free(timescale_val); + xmlFree(timescale_val); } if (startnumber_val) { rep->first_seq_no = (int64_t) strtoll(startnumber_val, NULL, 10); - av_free(startnumber_val); + xmlFree(startnumber_val); } fragment_timeline_node = find_child_node_by_name(representation_segmenttemplate_node, "SegmentTimeline"); @@ -760,11 +760,11 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, timescale_val = xmlGetProp(representation_segmentlist_node, "timescale"); if (duration_val) { rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 10); - av_free(duration_val); + xmlFree(duration_val); } if (timescale_val) { rep->fragment_timescale = (int64_t) strtoll(timescale_val, NULL, 10); - av_free(timescale_val); + xmlFree(timescale_val); } fragmenturl_node = xmlFirstElementChild(representation_segmentlist_node); while (fragmenturl_node) { @@ -816,9 +816,9 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, end: if (rep_id_val) - av_free(rep_id_val); + xmlFree(rep_id_val); if (rep_bandwidth_val) - av_free(rep_bandwidth_val); + xmlFree(rep_bandwidth_val); return ret; } @@ -941,7 +941,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) } if (!av_strcasecmp(val, (const char *)"dynamic")) c->is_live = 1; - av_free(val); + xmlFree(val); attr = node->properties; while (attr) { @@ -963,7 +963,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) c->media_presentation_duration = get_duration_insec(s, (const char *)val); } attr = attr->next; - av_free(val); + xmlFree(val); } mpd_baseurl_node = find_child_node_by_name(node, "BaseURL"); @@ -983,7 +983,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) perdiod_start_sec = get_duration_insec(s, (const char *)val); } attr = attr->next; - av_free(val); + xmlFree(val); } if ((perdiod_duration_sec) >= (c->period_duration)) { period_node = node;