From patchwork Thu Aug 16 13:36:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10010 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp2044723jad; Thu, 16 Aug 2018 06:36:56 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxAW9toDwXaZ9nZe7ZkRL6Wu9h8tG3Kkce5IaHa2678qzDoT4VEaMPxbarBDvftp//Kz9oj X-Received: by 2002:adf:e0cc:: with SMTP id e12-v6mr18552672wri.199.1534426616627; Thu, 16 Aug 2018 06:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534426616; cv=none; d=google.com; s=arc-20160816; b=YaSrBt/JiQwL9udtFt3Fda5v/vfLcBw3ETdU769kixhyXlsCGHnxMjf2MIW1fwsfQD FEXj9+XnObGhFwnyIAV5upUxiLtnegeSO3rZ4dvO/jBD+stnFCv4RbnYqhWRiU6dL+Vm 4MmiVHlJQ8EAiyrKLN7yb2cK/SJ6Ss3i+08TGK/FCYba1w/t898C2e0HaILcp2ILGx8V zFO4bHgZ9GVoHq3Tb9pMZGJ+3GBTeKv04fchkzskcWUdJAk5zfj39udZaqDmM/ly/lcU fMBeV/zIpVXOpgxVMwywlL+7TkJ6hJRPyJYgloD4wNB70iHj5ecNhvlFT4EkiosU5CFp Ddzg== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=Rts61yypgmJY6Yxx5Hm3YwB3tokB9R2CM9HM6Xag+f0=; b=XVJ+NGIHM438fX+qk+N+f5REMndiuTiBssx998ZFhiu1q1de32AVc76qAgLID0PfWM 4gIQFeJ5efeHEOeVYtbmn5jeDX2goDoqBvSNbNK6gSDuMLX0BYdAlNus6/BWY/1Resx6 NaqCC42Ue0C+LIV1+F8vQQ/r+8lP+JuhneCcmgi6a+PXPC6JF06O/Az1EXPSWb8sOWwZ rZO62BLq2WCeE/M+orHvgLb0PiHaAB2K4DL5PhnqFa4OBboCngEAhKBW3TT+5PQDcSk2 zcZQm1JiIlQVuahZ4301Q6z/BYNSGzKcfJQ01KcIpUoyMlEhLVCXP0PYHVKce7/BjUpM 8hhg== 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 x10-v6si909064wmg.5.2018.08.16.06.36.56; Thu, 16 Aug 2018 06:36: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 0855068A727; Thu, 16 Aug 2018 16:36:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-2.mx.upcmail.net (vie01a-qmta-pe01-2.mx.upcmail.net [62.179.121.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B6FB68A6CF for ; Thu, 16 Aug 2018 16:36:17 +0300 (EEST) Received: from [172.31.218.51] (helo=vie01a-dmta-pe07-3.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fqISA-0000tw-J1 for ffmpeg-devel@ffmpeg.org; Thu, 16 Aug 2018 15:36:42 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fqIS5-0007qq-BC for ffmpeg-devel@ffmpeg.org; Thu, 16 Aug 2018 15:36:37 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id Ppca1y00W0S5wYM01pcbJV; Thu, 16 Aug 2018 15:36:35 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 16 Aug 2018 15:36:29 +0200 Message-Id: <20180816133629.9352-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180816133629.9352-1-michael@niedermayer.cc> References: <20180816133629.9352-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/3] avformat/rmdec: Fix EOF check in the stream loop in ivr_read_header() 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" Fixes: long running loop Fixes: ivr-timeout-42468cb797f52f025fb329394702f5d4d64322d6 Found-by: Paul Ch Signed-off-by: Michael Niedermayer --- libavformat/rmdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 0216003e88..f26c5b4d90 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -1269,6 +1269,8 @@ static int ivr_read_header(AVFormatContext *s) if (avio_rb32(pb) == MKBETAG('M', 'L', 'T', 'I')) { ret = rm_read_multi(s, pb, st, NULL); } else { + if (avio_feof(pb)) + return AVERROR_INVALIDDATA; avio_seek(pb, -4, SEEK_CUR); ret = ff_rm_read_mdpr_codecdata(s, pb, st, st->priv_data, len, NULL); }