From patchwork Sun Dec 4 23:50:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 39593 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp2863155pzb; Sun, 4 Dec 2022 15:50:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf7lZfk+sKbBhmqUc0u/9GuK1dvSy5qsZFm1uJsHQy0q8sdcgj2Pqia9itSL7ohCQe/M/uyO X-Received: by 2002:a17:906:7c45:b0:7c0:c45c:90e4 with SMTP id g5-20020a1709067c4500b007c0c45c90e4mr9826325ejp.473.1670197821558; Sun, 04 Dec 2022 15:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670197821; cv=none; d=google.com; s=arc-20160816; b=AzwpG2JnqoMehf7ynbrS6TvXEoEfsTrVr6EelMIiL2ZmBUv8rTNrINUoeiEuMPhMZE yIrY7mqhxr7bo9dy+8Teis+ObfBBLEUdxCV1a5Kz1pIB93mAFD1Y2hCGxVX5xUmqzI1y GQyD3eHy+tRXCfI52Uo+gd3G/rBSbP9x8ht8nqu3G1eF4T4+FHEbFZUvdZIKp3F3Q1Sa lky3u08r+hn/FTNDlA89vgd9OPh/d15UY1ShFp54Z+tFaVV2DKOGZaMle6IpC0wKDV7V cEUuDbqa8HkVZU581V7nylVpMxeO1phM9s02TxpbXNSY9u29pOV9WWzTWFPSFmbCIi/G pCwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=WhyUAkZ1yead2DOT7rrfmmSvrd3zmiVi2MjEnaa5ScI=; b=juhGygB/W50K1M4f9DwhUmjz1AdZYhTBU/kIm7zW5ce64LNxfzCq7cGK0z9SpH5YZW PP4kbQC1i7aQkZvLJ02DDbwOHT9UNu3PTzYE8Ij8xO44dE8eyfDJ56mFZQI6u1d2IJbH k8NjrZOIsPepQdJ2SBh9I15X3SjT3O5PNE7BO8ORSun8hffhAvgJOtgyF365PCqUhrxH D9TU/o6hOm3un2uZa4Q3e3cI2DXy8aW+syabZNp899sKi8cs1HVCQ+J+hwrylNnCXWrR sphxRCG0ivQwnO/4g35O/un6qvUEzAE9E9FoLdh60NqGFR23JtmQ+7aN50O4xzRRUCpy dSIA== 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 g14-20020a1709065d0e00b007a4feae7ae7si12605720ejt.575.2022.12.04.15.50.20; Sun, 04 Dec 2022 15:50:21 -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 5D23268BBFC; Mon, 5 Dec 2022 01:50:17 +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 CAF1068B72B for ; Mon, 5 Dec 2022 01:50:10 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 6BD38E8204; Mon, 5 Dec 2022 00:50:08 +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 ZiMBM4jAUGNN; Mon, 5 Dec 2022 00:50:07 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 0F52FE8201; Mon, 5 Dec 2022 00:50:07 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Dec 2022 00:50:01 +0100 Message-Id: <20221204235002.26754-1-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/mov: do not emit zero sized packets X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: V8VaK5t3IlQ3 Signed-off-by: Marton Balint --- libavformat/mov.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 29bd3103e3..935b2f8d9f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -8772,6 +8772,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) goto retry; } + /* Empty packet or corrupt index? */ + if (!sample->size) + goto retry; + if (st->codecpar->codec_id == AV_CODEC_ID_EIA_608 && sample->size > 8) ret = get_eia608_packet(sc->pb, pkt, sample->size); else