From patchwork Sat Apr 13 13:11:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 48042 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:670b:b0:1a9:af23:56c1 with SMTP id wh11csp834760pzb; Sat, 13 Apr 2024 06:11:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNr6+faKwxPu+NKzLaWmgR+xrKOU2lU09+yl7pLnhUBCGBbXuEj+dU5zH34RBadUlcmAsCLuB1/GzkfTYuOXIhHO2q1iSZ2Y+ywQ== X-Google-Smtp-Source: AGHT+IGK0xIFBOpVtzPHV/Qw2WbSWOgTVxsmmgT1+B8xcdCe1AMjFqfaW3Afqt61TxZYfI6VW9dn X-Received: by 2002:a17:906:fa08:b0:a51:c53f:5295 with SMTP id lo8-20020a170906fa0800b00a51c53f5295mr3035305ejb.5.1713013886621; Sat, 13 Apr 2024 06:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713013886; cv=none; d=google.com; s=arc-20160816; b=jjYaDj1B4oLwgyDgnNv3VHDOk0GcqI/NBm2Nd1QDeIAAFhwkZCrxH0d7nKpAybNh/n jXaviaCPyGSHrl2X4CRYYu6ZUktXG/xnXDSbYlBs0OcNbch3Bv+WJ5mdJuu8nbNVwaQ5 oBONpAa6S+fE8/xLRo/dTATNg3JNmzuTfaNNr37dSIF4xwLSUr48k6ssASkDNKT/puZD ZjjF0HvYE+fjI7CwxIitBG8MjrefwRGdBY7jV/lJc13nG0yRpLN3LToFb2NgOI/EBkeG klZqbT9SvdIJhiJ0TElJ57lZSeCc/nIksErwnnuycWox4SmcppgyV1536RSRaGjLMdTm s+CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=KqOM/8VFqs2Lxn+eus+8O7iOdeO6Fy/yqBVG2vsSApA=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=0Il4q3HiYztJt5r7/vny4OQx7B9N6YAh5gS564OE+HRZxXhhuuAZk89PuJr7EfzlE8 IASfOA7fJPe7UUHrf3ud2MW+wmj6j6Ltk8cOHZ+D5xPPlNA4NSuhFOWx9TgRbcu108c2 015/sC+Vdxm2aV3UPIyGQwNjqutL0ecT/ygnpMBY+jDyOTABvD82J/2tUaAaq7IHHC+m WkcnDbq/wdMWD1l6YkFXxzY6IVtDgHo0Wq2XS69LsXDrbX6jGfYWEoL9opEUnJ5/kqiW PhgpPL0Jvgx2SM61Ldj/yhme4APrfEnk2CgoljeZLdXsTrPnPNZZCDlnkEvqbs7DbZId WPxQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=Yc5Zbm7o; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ji15-20020a170907980f00b00a51d285c678si2697767ejc.1028.2024.04.13.06.11.25; Sat, 13 Apr 2024 06:11:26 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=Yc5Zbm7o; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 568C868D308; Sat, 13 Apr 2024 16:11:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 17A3A68CB86 for ; Sat, 13 Apr 2024 16:11:16 +0300 (EEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6ed11782727so1478114b3a.1 for ; Sat, 13 Apr 2024 06:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713013874; x=1713618674; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=B6AHZKlfGINFONkkRb9RoGhzxoAWsHlzJUc+os0LYeg=; b=Yc5Zbm7oA3AVqxlhMWMg87t4fSYDN2XXXUlqKTW4i4+2wwrBBxdv1ZD7a9He6l2MFh Od2oaE4JwoKT/GfLV5qYrn9ohspd7vZwMQMYabH8z5pfFNgYKRLicGuxg2xuxGNBelGu Nqc7l936agws+OYQCuKdHPgWQdtFaUnzR2QWWNtyqbOl0ymhv+izgNL6kFtrM/R6cfsQ 3hsZqheT66s5cJ7Uh0YR9NG52wVrZaaJR/FU7UTe9tn5FmaTlako/1wOQa/6jNrUjfFp /5LBK5qbMZhpxKRcuEFjXL8qL9JSKuXZQDIATrFmZFbwBt/8b6qKYbOrvf56gi1ELWEj WT4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713013874; x=1713618674; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B6AHZKlfGINFONkkRb9RoGhzxoAWsHlzJUc+os0LYeg=; b=Jx9DURCElog9kKP0CMC6stfCxPaLQ07K6+vj8QDc5RHIKb10hLm86ya/S16PKu2jdQ oTrgw+X6W+7iPJA1HVg46agiK7Gx3AQvTEUPNtap0vG8kTTXjNJ2VtK8Hb3cfx8gUWf2 ss0MeQTLKzO2TRMkoGizyQcIcuohUFOJYSvZ0IF8fS68WLcUxOOKSufo2NWDRjB7djwK VVo4bwy72Pz069Rj+4wVgzrJ52sUTfrKW92SC4ePIRzBYjrnQHDkQpf0EIR3E3nvixNq RqsRz04w4w1XBypJLSClPCy9/OgDl0lRbYZnwc3B1fnHcAOaGCJtZFjITbruPG4/kcTX AuhQ== X-Gm-Message-State: AOJu0YyBFMa9bl0lv4062pSdKSMM6Y1t5Sys+jxkwXBTxiKzTKL5Mag6 P8RpjuntVN1cD0ngbhq2md4TeEOZHH9Wy5e1VlVaaVeFnWRxgK7BYHtrsQ== X-Received: by 2002:a05:6a00:189c:b0:6e6:ac71:8b38 with SMTP id x28-20020a056a00189c00b006e6ac718b38mr5803887pfh.22.1713013873692; Sat, 13 Apr 2024 06:11:13 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id t22-20020aa78f96000000b006ede45680a6sm4358967pfs.59.2024.04.13.06.11.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 06:11:13 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Apr 2024 10:11:03 -0300 Message-ID: <20240413131103.2693-1-jamrial@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/mov: ignore old infe box versions 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: mjAcMNl2EUPF Some files with no image items have them, and were working prior to the recent HEIF parsing overhaul. Ignore such boxes instead, to recover the old behavior. Fixes a regression since d9fed9df2a9e70c9375d3b2591db35c09303d369. Signed-off-by: James Almer --- libavformat/mov.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 0c892b56c8..160e0b14fb 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -8137,8 +8137,8 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom, int idx) size -= 4; if (version < 2) { - av_log(c->fc, AV_LOG_ERROR, "infe: version < 2 not supported\n"); - return AVERROR_PATCHWELCOME; + avpriv_report_missing_feature(c->fc, "infe version < 2"); + return 1; } item_id = version > 2 ? avio_rb32(pb) : avio_rb16(pb); @@ -8209,6 +8209,8 @@ static int mov_read_iinf(MOVContext *c, AVIOContext *pb, MOVAtom atom) ret = mov_read_infe(c, pb, infe, i); if (ret < 0) return ret; + if (ret) + return 0; } c->found_iinf = 1; @@ -9508,14 +9510,15 @@ static int mov_read_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "error reading header\n"); return err; } - } while ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mov->found_moov && !mov->found_iloc && !mov->moov_retry++); - if (!mov->found_moov && !mov->found_iloc) { + } while ((pb->seekable & AVIO_SEEKABLE_NORMAL) && + !mov->found_moov && !mov->found_iloc && !mov->found_iinf && !mov->moov_retry++); + if (!mov->found_moov && !mov->found_iloc && !mov->found_iinf) { av_log(s, AV_LOG_ERROR, "moov atom not found\n"); return AVERROR_INVALIDDATA; } av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb)); - if (mov->found_iloc) { + if (mov->found_iloc && mov->found_iinf) { for (i = 0; i < mov->nb_heif_item; i++) { HEIFItem *item = &mov->heif_item[i]; MOVStreamContext *sc;