From patchwork Sun May 13 20:26:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 8940 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp3276375jad; Sun, 13 May 2018 13:26:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoqoqCMW0venipVOf/RRYhTh0n8l8FQIq1KLeMRmv/oBaijGeL1wqT6Ds+/5WglBJCHEYyv X-Received: by 2002:adf:8af0:: with SMTP id z45-v6mr4643064wrz.150.1526243196024; Sun, 13 May 2018 13:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526243195; cv=none; d=google.com; s=arc-20160816; b=Gx8ztc0ZCKxIRNlAQGztK/wz4BpeLTLq+nQin8RPc1Lddowwmd7/yeB4je7ODqj8N6 +0iKqgDxzo7BupX838crWR/n9TFHlv+cDjY9/hr/OGHQdo09ooZs1xBt14KgBFJIY9/5 T7chLaGOz3N3pJi4KiWLTv7aJTSPg5sC7N0avtVG2OlssEbOtaEbt2PwRb793YFg6OAt QiaHKa55dvzBUHdH/eafT2WC/IZ+aNt8VJ1HnsxoLu3VE6GA4nnVus6WS1/ITGhc7GdN 05/1OrtgfzZQoz7gMSw/aseSSoe3CEVBpctpLguH2bgwCW8ZXlMxwaVQnhiiJmqD7eKd X9uw== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=5V2+qP08Dk2oykKfcckPzE2TKBU8Oc/y1O3LrqFlLxE=; b=teKkPFsPijlZPrkO7VMkx0DiAHpfZdsy46lr98fqoiLUKQO+G4TppcN2htlteN880R eg11ZI5qgzyOCTtzMOyCzZp5HO5etKXyJP8rzNp1dPXBk+rHpTEeUoOpKiEHYgJ/QckL RXZy2yhWRtPiYSagXLM8oXSyPw4ZAiIuM3T4SYo+FI5E8yOVPi5TYh0KR+QsigyKOFx4 DDBGtbnB0pAg4crF+mLIwrhzGKktCgVPvvM1gytgSP+wZOv2xkvL1zo7K+fFs6EbBHIg CUVjmDfuh+jDa5rqlB/FklkDVFNc+1UUpPXAXpxZUs7+a0k4AvctTe4oWtA+c1ceLhZa 4u1Q== 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 l132-v6si4228622wmb.189.2018.05.13.13.26.34; Sun, 13 May 2018 13:26:35 -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 2CAFE68A4B8; Sun, 13 May 2018 23:25:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5B23968A3C8 for ; Sun, 13 May 2018 23:25:49 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 99C01E1195; Sun, 13 May 2018 22:26:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C5MnVn3aRCG1; Sun, 13 May 2018 22:26:25 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id EE5BCE0E2F; Sun, 13 May 2018 22:26:24 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 13 May 2018 22:26:19 +0200 Message-Id: <20180513202619.14047-1-cus@passwd.hu> X-Mailer: git-send-email 2.13.6 Subject: [FFmpeg-devel] [PATCH] avformat/webm_chunk: always use a static buffer for get_chunk_filename 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" My conversation from AVFormatContext->filename to AVFormatContext->url was wrong in this case because get_chunk_filename uses filename as an output buffer, and not as an input buffer. Fixes ticket #7188. Signed-off-by: Marton Balint --- libavformat/webm_chunk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c index 549ec2879a..7ceb276fc4 100644 --- a/libavformat/webm_chunk.c +++ b/libavformat/webm_chunk.c @@ -114,6 +114,8 @@ static int webm_chunk_write_header(AVFormatContext *s) int ret; int i; AVDictionary *options = NULL; + char oc_filename[MAX_FILENAME_SIZE]; + char *oc_url; // DASH Streams can only have either one track per file. if (s->nb_streams != 1) { return AVERROR_INVALIDDATA; } @@ -127,9 +129,13 @@ static int webm_chunk_write_header(AVFormatContext *s) if (ret < 0) return ret; oc = wc->avf; - ret = get_chunk_filename(s, 1, oc->url); + ret = get_chunk_filename(s, 1, oc_filename); if (ret < 0) return ret; + oc_url = av_strdup(oc_filename); + if (!oc_url) + return AVERROR(ENOMEM); + ff_format_set_url(oc, oc_url); if (wc->http_method) av_dict_set(&options, "method", wc->http_method, 0); ret = s->io_open(s, &oc->pb, oc->url, AVIO_FLAG_WRITE, &options);