From patchwork Sun Jan 7 18:46:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sfan5 X-Patchwork-Id: 7183 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.78.2 with SMTP id r2csp1815929jaa; Sun, 7 Jan 2018 10:46:49 -0800 (PST) X-Google-Smtp-Source: ACJfBouDFNV/J9YgPXr8wJHqmJDkpgOzSiPcP8U/Isc4xfluW8ABumPUvtCWq7QgTQudwH8T9380 X-Received: by 10.28.1.196 with SMTP id 187mr7834057wmb.154.1515350809331; Sun, 07 Jan 2018 10:46:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515350809; cv=none; d=google.com; s=arc-20160816; b=CXZbPhhP7GN+HahlhAM9pYqRZ5+BQVzjKF590eaxtMUU/fEVvGNUfgj3psksYADcZp wrBN0bMFbK3Wzjq+5YWdhZUO5U8SSitOQojeMtqxy1P/z3j8zsJfIUfDBwZjuGx5TpBL 8q3T7n3D/REgfPbH29dwrdEfefL2IQP7c05mzIG9G+WPnwJjKFj39Bn/cGgxD68ShjOp OOL6i046N4KoQZzmeFlI3gyYsd9wrPrZloUSQrYhdXoPauIXenlGCmsFwOnPhXM2A6QN H8TVjKhNmzGc49CObFEp69LKsRNAaWNsmNezsDXjZEzURfXlJCykzovLWigNoYB1s7wp Kakw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:message-id:date:thread-index :thread-topic:to:from:delivered-to:arc-authentication-results; bh=/L/rK1aCBfDEs1Vw1YJd2wPlbUCHu1P6Bgynypxet8g=; b=v1TlXrIBz2lGuzdZb4o6pWEYbUOMnQVoVNn/EQkhrWkksPhiA1BXXf+IWQpYzj5dO0 YGvm4nGq3no8bi+9RMPAgEQ4jrSi5phP1Fw4P5kEMLaQA/AUYHsjkaBnwec55Ilg/gBp Wu0pu+0Q7zM80xrijanwdROfMwrVOJG5XpvMYiWx7CHsPo5I6l78H+U4UfQ0sE4CJWl8 4UfAKOm5A37bwV7zIwEfNm9EIxEWKoQn1QzBe8rHSzYWP17Qwl0c6DCQAs8eHS9TxHF3 PVyqny/RwqmZPA+2HWLApdguL8oO41jS1qtgC+9xex9upqd89B6xwz43h+pxpjHkB/xl 6+Ig== 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 k10si7803425wrg.303.2018.01.07.10.46.48; Sun, 07 Jan 2018 10:46:49 -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; 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 BF754689E8A; Sun, 7 Jan 2018 20:46:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-oln040092071038.outbound.protection.outlook.com [40.92.71.38]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6120F689E65 for ; Sun, 7 Jan 2018 20:46:11 +0200 (EET) Received: from VE1EUR03FT036.eop-EUR03.prod.protection.outlook.com (10.152.18.53) by VE1EUR03HT111.eop-EUR03.prod.protection.outlook.com (10.152.19.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.345.12; Sun, 7 Jan 2018 18:46:11 +0000 Received: from DB3PR0202MB3452.eurprd02.prod.outlook.com (10.152.18.60) by VE1EUR03FT036.mail.protection.outlook.com (10.152.19.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.345.12 via Frontend Transport; Sun, 7 Jan 2018 18:46:11 +0000 Received: from DB3PR0202MB3452.eurprd02.prod.outlook.com ([fe80::f937:4ad2:ba75:414]) by DB3PR0202MB3452.eurprd02.prod.outlook.com ([fe80::f937:4ad2:ba75:414%13]) with mapi id 15.20.0386.008; Sun, 7 Jan 2018 18:46:11 +0000 From: Stefan _ To: FFmpeg development discussions and patches Thread-Topic: [PATCH 5/6] dashdec: Avoid trying to read any segments beyond the last Thread-Index: AQHTh+fJ63H0VDf7BkC45yNEx5XLwg== Date: Sun, 7 Jan 2018 18:46:11 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:52CBAB562070038D53D5DDF32D27FED123C95B5DDB66A196E9BD98F4AF5DFCDE; UpperCasedChecksum:FDB2FA3E09347BE1D53ED510A265EDDCD6BCD51EC724DA8E13225D17FF3ED082; SizeAsReceived:6964; Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [MWfd4L7f9qmigIt58HJTbctCv5VrxhLt] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VE1EUR03HT111; 7:pNtGaDGQHZV7yX/zBTpfZFMKoa/qjnvlZC/HpmyZSvM5CnDUqf891hk1dQwXFta8LmoObbO15SByzpcf1doaNHojqgLS8Y9TBZBiscc8Y9tmuDaGTPVuRQCKjaRAem+t7H+6QXmSG5H98oAGfyk/VbSvlH05sA0LCt2KDPuPxWlVkfIL02F4x4sc2UthmRNG169ysx3IlC9/+Vz0pW455LoMqgwTVUCuSJcU7pjY7kYLEEQ29B7EMKe77nKza/A+ x-incomingheadercount: 44 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125374)(1701031045); SRVR:VE1EUR03HT111; x-ms-traffictypediagnostic: VE1EUR03HT111: x-ms-office365-filtering-correlation-id: 7df61fd3-7758-447c-86fd-08d555feebbe x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:VE1EUR03HT111; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VE1EUR03HT111; x-forefront-prvs: 0545EFAC9A x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:VE1EUR03HT111; H:DB3PR0202MB3452.eurprd02.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7df61fd3-7758-447c-86fd-08d555feebbe X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2018 18:46:11.0792 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT111 Subject: [FFmpeg-devel] [PATCH 5/6] dashdec: Avoid trying to read any segments beyond the last 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" >From 277c710159849816bff4e4f5ccd1139348518620 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 5 Jan 2018 14:19:25 +0100 Subject: [PATCH 5/6] dashdec: Avoid trying to read any segments beyond the last --- libavformat/dashdec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 1252d4156..af8ab5f2f 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1505,9 +1505,11 @@ restart: if (ret > 0) goto end; - if (!v->is_restart_needed) - v->cur_seq_no++; - v->is_restart_needed = 1; + if (c->is_live || v->cur_seq_no < v->last_seq_no) { + if (!v->is_restart_needed) + v->cur_seq_no++; + v->is_restart_needed = 1; + } end: return ret; -- 2.15.1