From patchwork Mon Nov 6 16:29:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 5891 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp3078682jah; Mon, 6 Nov 2017 08:30:19 -0800 (PST) X-Google-Smtp-Source: ABhQp+TeTL4SMffJIHy1x1R41khscypFpqaTCqViQAcdLZw8sh3JHYrm1VylNxCBGaQePIfST7gT X-Received: by 10.223.149.6 with SMTP id 6mr3851179wrs.112.1509985819129; Mon, 06 Nov 2017 08:30:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509985819; cv=none; d=google.com; s=arc-20160816; b=GXqEkLxFhIrzOfTYAwOfoIW43/IR9hUoBriE/RxD3Z0X1/C3jrtmLo0ZZ4c6yajY3s UoK1FsJPg8ACUTfuF04TGfDjfC67FK5f9Mf7PdAwI0bmDEALib447d+BydbxJ/s65Jea ediFZ4jSFPpeBLB0k/+M5EQtPaPSqRLUPefIYH28a+i2ak56Q+DKZA1+sqsHEE8tTMcD IzsN4c4BL2wXTclhgOVStg3kxZFLf5WzltfPaoiEU9zSxfUWllhUUnL95D7Kv1mzGs3q nZYJsqC1DMgo9Dj3Eu7g1wsOihmsqSOMSUCnkdfot4dOCw+JgPmnPan/E+DGliurOmn0 My0w== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=LBjPDcOm+J+HytxxzMugy2gRvCFupHk3fxTuLPXosp0=; b=EnvEu9YHdNA+5xVUGNBKiAi1BrXDYf1rp1ndPedKjNvij83E3ge5ie9vKxZZEa7+9l +K9/NCd5oJSVa2mwg3kyuLUaBb6Owv4NTjP6bWP5QR7l2LEkq3Ze1M+tT4AAVeqtkapp sodSmFBTrOuTzArobC0gFU5oXe+opEC0zDvESUM0nCulICblCj2nnJe6fACQsQLagNp/ 7PeVG5ka1JZNwMv8H/xwBZYb2VQxdbCKUolW+Arg0n7SunvLEeK/wCj837vIDHzmAKzE 3Xy6/F2tdAEwq3BYqU3U3utaF+8P6/OOvHNzWNfle2R4TkdhC7Fn8tn/D5yrMUf6VUo6 I7BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Yn2Dr70S; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p2si6804035wme.5.2017.11.06.08.30.18; Mon, 06 Nov 2017 08:30:19 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Yn2Dr70S; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7673688294; Mon, 6 Nov 2017 18:30:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0C3F168826D for ; Mon, 6 Nov 2017 18:29:58 +0200 (EET) Received: by mail-qk0-f194.google.com with SMTP id q83so11634957qke.6 for ; Mon, 06 Nov 2017 08:30:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=86efLliEqAcKeEpYLDbDD2MZbPDxPH2kuKiLvD1uyYA=; b=Yn2Dr70SNQqGdWfbLMPYo5RJAw1v5cptNKjsrOJoTCmWcOPhN5FZJHLk6rLQzFaEZy JwUvueFeA3LGXkIFibvGok241RvqPQagiQKRTB6cVboyOBFhP4ONXePff1Y4zznv3zs8 sSaksGrCtYKNHWF/NBT0RYxOpIH0AGDRMfbAmQxXu3h7i2/mzUv7DuEoGU0Hu/j22QaI p0Ea7MkJzmKd8uxqUyE0OtXMLe4SJjn3a7dBc3q4ZWsUKsqEuuJ9aW7ncF3I1gz3Wrwh Ep0xrjkToM5DGylUEwlPlSGtMQbIdHGM/EODEQylnb4wTb6qnfnM7aq7IRASYSw5mvoJ UriA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=86efLliEqAcKeEpYLDbDD2MZbPDxPH2kuKiLvD1uyYA=; b=I7EvntgSEvJhGdORK9Ysx1XxXADVjMgJwmvcWtWkgoZ9IUCfwx3mjgW3VX+Sl5GI5P RvmSyPSG9uvn4oXBNR/JvV2sYQ5VqhbpJyYPaUG3QQVrM1TWA4oMxh0hYEd8pdCFp/vY XEArpxI/rqd7d9HSPgbXHyBivzCnAnZom4u4heUnSwEfQz7FYVhwvdyhdFAc39x5Qvds E7DnwbZKv9rv421MpCFLu8NdNDJr/nWpS9Lb3vhwmkKCIebLbVS3sFXbXaPpV2uXkjGl fSvpAggnWJUFkmyitkwzW/DOyfewUYQJ4kSSbwZfaQRLve1OuMLfV5PXG/L19sBJspBc 90yA== X-Gm-Message-State: AMCzsaWbjntAmjZAU0NF8B8EULFaLOOp3g1iECkRzhq2BgyDd9MCfPdu kDOTAij1rdVCX0weF5fpCNfeaA== X-Received: by 10.233.244.74 with SMTP id z10mr22262923qkl.31.1509985808719; Mon, 06 Nov 2017 08:30:08 -0800 (PST) Received: from localhost.localdomain ([181.231.59.220]) by smtp.gmail.com with ESMTPSA id p31sm8770281qtj.12.2017.11.06.08.30.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Nov 2017 08:30:08 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 6 Nov 2017 13:29:33 -0300 Message-Id: <20171106162933.5128-1-jamrial@gmail.com> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH] avformat/rtpdec_asf: free the buffer pointed by the AVIOContext 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Don't free the buffer allocated in ff_wms_parse_sdp_a_line() after calling avformat_open_input(), as it may free it and replace it with another one. Should fix ticket #6808 Signed-off-by: James Almer --- Untested. libavformat/rtpdec_asf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c index 2c09fda10b..09f214a71c 100644 --- a/libavformat/rtpdec_asf.c +++ b/libavformat/rtpdec_asf.c @@ -139,12 +139,12 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p) ret = avformat_open_input(&rt->asf_ctx, "", iformat, &opts); av_dict_free(&opts); if (ret < 0) { - av_free(buf); + av_free(pb.buffer); return ret; } av_dict_copy(&s->metadata, rt->asf_ctx->metadata, 0); rt->asf_pb_pos = avio_tell(&pb); - av_free(buf); + av_free(pb.buffer); rt->asf_ctx->pb = NULL; } return ret;