From patchwork Sun Mar 11 17:12:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 7901 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.1.70 with SMTP id c67csp768818jad; Sun, 11 Mar 2018 10:12:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELsSNvpeJfe9QbHc7K6dN1eWqBWaYJr/injsX+8FPlGeFgPlkwrRu4rpfeDnVORgQJEBkYxB X-Received: by 10.28.166.206 with SMTP id p197mr3303973wme.81.1520788340149; Sun, 11 Mar 2018 10:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520788340; cv=none; d=google.com; s=arc-20160816; b=c515t1HYzFL98B28mSJMPbcUrBRWpeeQ1xX9oMRfE8Y88U44MxaKgFLVdO/bduDTXb pxl1DVILNgctfrsHF5DLpOXR1uV60W/zNDHrOSBdZPfUgKgWZ6oKYJXG7ViV/YLCaZ66 KmDPzH4TbUFT+2Tx8y/H5GmX4A9I+WLIW31zByqOiq/JwhdCEGLNZI1+SbTuQcUs3Csa oGYASgltEbthb7lhXYbuVBLCOFh3bcN2oTwlVSids9k6cq9bv5EKfwh4Wdwb0VC6smr/ O9v2bL/afJJKlI2If4fqitdIhIDyDTs7rulpRi1e3a+JN3ZDWDjurVqzyhpfT9PwDfZQ oxww== 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=ldMzihCQ6E4zDRs1LFPWtEA2UUl4IwsqVMimEHZbiLk=; b=pa+Nw+oaHZt0QY9AgFL1D7e5vWYOryKGBBEsI8wNjRLIFmfBhmDKELvdFLS9E2Hj9J ZOVyYunbaS4VXmEy5ChxP4Z8nJ98FXXlltJvsUx3K8aO1USoBH9sDHZxb9qTFi3Fchuf QVBv8Ht+gLxM7jBXlDSaCG1sqKaZnkILw8PTTDMALSqZsBsN3DKSTMjcaz6qRzmyYpl+ Yj1jFZ3aLEq6srstE3vG6+SR82c2MJK07BDcdFyUuBAUpu52JFWUBDLWXLhAl5A1rR0X o/rQccRcxi4QPb0TIYZxbloK9IaN/OCnFD3tDl4RhRVpQvlbbL/XNa71bQC1GWHgz+Ym 9nDg== 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 c14si2118163wmi.215.2018.03.11.10.12.19; Sun, 11 Mar 2018 10:12:20 -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 8C09F68A1CB; Sun, 11 Mar 2018 19:12:08 +0200 (EET) 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 4354668A13F for ; Sun, 11 Mar 2018 19:12:02 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B3F8AE0E22; Sun, 11 Mar 2018 18:12:11 +0100 (CET) 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 wn-2TthmlNhZ; Sun, 11 Mar 2018 18:12:10 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 6C2E4E088C; Sun, 11 Mar 2018 18:12:10 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 11 Mar 2018 18:12:05 +0100 Message-Id: <20180311171205.26887-1-cus@passwd.hu> X-Mailer: git-send-email 2.13.6 Subject: [FFmpeg-devel] [PATCH] ffprobe: fix infinite loop in subtitle decoding 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" Fixes a regression since 2a88ebd096f3c748a2d99ed1b60b22879b3c567c which caused an infinite loop in the subtitle decoding. Fixes ticket #6796. Signed-off-by: Marton Balint --- fftools/ffprobe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 967adbe30c..d8032bfddf 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2275,7 +2275,8 @@ static av_always_inline int process_frame(WriterContext *w, break; case AVMEDIA_TYPE_SUBTITLE: - ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_frame, pkt); + if (*packet_new || !pkt->data) + ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_frame, pkt); *packet_new = 0; break; default: