From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 693A54C017 for ; Mon, 6 Oct 2025 13:27:24 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'az/0vxiHpehInE0zK6H94G7bs7tSt0EBCN06VxgMPvo=', expected b'kVzWbLZ+RhTPYwykxCopdxBUsLMCRHQkBn1EsOh4uFI=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1759757237; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=az/0vxiHpehInE0zK6H94G7bs7tSt0EBCN06VxgMPvo=; b=evhMFotD9nzBXJCeL295QWu9PI276Fqwm4ntoLBfsvLglkjS71HYnbSxnjmOLvNoJaO4j D5l9mwAiIyYBfK1elQqwwifwRFfb6abf0itTS0Z5OealtebkNSR+zzL2QpO4YkgDTu+JBIA FUFrYQQyIgp8G60JuGyt1iFydgZaCdTsf6HwFYFLuJ7ne6rJIY9NtJJ2uGC09oqQvUtGAz1 hmjHF4VkQDL9dYRMMs3vC+4I6mhv0LeQktqf8lQbYYmbxNJbOPBcOK5be9nWLNsaNd6s0QD 0P1ooOLktx6UpfO6HGDitXFJJuEqQZwhXH+9pU0snHnwY4/Yh8PtQbVWVYJw== Received: from [172.18.0.2] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 58E3E68EFDE; Mon, 6 Oct 2025 16:27:17 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1759757226; b=Ij4Cpp3/HL8OJYVe6EaLRt+tnZvBXpiccgHTqXmA3RSs2lwszVYjgiUl2EZyz0Y7ZZXio +r80eSfRUEpQJ27HX5he2VSrF8iLf+gr2/NLv2xTEDgS19qGbQnBZxfttwsyrEdYy1yi+ny Jd7fLdBcIMAMTfhUPzEDKwqu8Mrugyt2itzNzkc9yPOQrMKBMmpSe3QFZEiFzPknCd+s6IN k9yVefppgQogZBC6Du8xmjvu2bxIXFBj+avCEAXzYVowcB4ZIRoavTZSYQYql8UuRUaDKEL 5C7DspNnkinQgb04iUMgbZ2TkJkFdVIArHqlm7M4k8vtl4zPN9JEcuwxnq/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1759757226; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=nJObckfsrnAuF8tNDecFCuznyVFwX7vZEls3sxx2XSI=; b=Dk9tHE28yF23HrT6pQeXtQXIoA1P0qi70YJNrrAINx2eXk60GBQlwEA0/uR5HQ+b2bG9k 32JNleqa+HURrJTYWwj63rkU30/z9PuWiqESSJIGDuFa3ucJCilvjDakS7VmaXNEqYLFJdN FwlYrVzOd+UAFFr7re0zbQMzJx18NRgrYBB91NU2JkKsHZ0R6j8kbshdcfC3vMVmiJKZATv afTyYRSE2DN1IwmMhrlxmxurdHGCUfphKEwnEmRDiSddMTRIyKkb6/KlzKcih/sTkS62XnJ Ryk27cCT8/qRdGgGJNAMcZfihwGvxjwGYux3t1R7CRPvc57NUNNMtETdEcsw== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1759757219; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=kVzWbLZ+RhTPYwykxCopdxBUsLMCRHQkBn1EsOh4uFI=; b=OkdzEsPWW8qvIMTqZzSozRQv2+s1jmYEJNjchBzKTRZqzJo7/Ua8UzAgVd/xb20oUtDuV AwUFptxy+o0jHnjP5J5b6i7AulcAERGup1j/hFFLcwcoI23G06gN7TdZincuHqVo3sLRIpT kpqKQdbheJZrhtO1y4ih+Ebc91V9QLXmAxApsWgx5Beq07L7rnsPaMjY1dsVrtC/KpoRaXx m5Th2slKSvixmtebvH5sC7EIgiQRAzi3QU5prgP2x6htoQerq0i3rbU6thxMw6x9GTDxDZW AtRTs8twbm1kS2yn2ZxzhKt4aFYYAm6HYgV75JdPNWn9T69JRbwSv5tttjMA== Received: from be50bb5a3685 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 970CE68EFC9 for ; Mon, 6 Oct 2025 16:26:59 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Mon, 06 Oct 2025 13:26:59 -0000 Message-ID: <175975721977.65.8535338401202285423@bf249f23a2c8> Message-ID-Hash: RUDOYMKSXHMB5ZZSS7OFBIOOSNBU6M4D X-Message-ID-Hash: RUDOYMKSXHMB5ZZSS7OFBIOOSNBU6M4D X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avformat/matroskadec: relax the check for cropped dimensions (PR #20653) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: James Almer via ffmpeg-devel Cc: James Almer Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20653 opened by James Almer (jamrial) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20653 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20653.patch There seem to be samples with no Video element on video tracks in the wild, which even if not spec compliant, can be demuxed fine after lavf probes the stream with a decoder/parser. Relax the check to allow tracks with no dimensions to work, and also add a check for strict spec compliance to maintain the current behavior if desired. Fixes issue #20649. >>From 0de01622dd901e78a1d6a4faef0f18afba537667 Mon Sep 17 00:00:00 2001 From: James Almer Date: Mon, 6 Oct 2025 10:21:03 -0300 Subject: [PATCH] avformat/matroskadec: relax the check for cropped dimensions There seem to be samples with no Video element on video tracks in the wild, which even if not spec compliant, can be demuxed fine after lavf probes the stream with a decoder/parser. Relax the check to allow tracks with no dimensions to work, and also add a check for strict spec compliance to maintain the current behavior if desired. Fixes issue #20649. Signed-off-by: James Almer --- libavformat/matroskadec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 6c12e1594c..c4190cc059 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3168,10 +3168,13 @@ static int matroska_parse_tracks(AVFormatContext *s) track->default_duration = default_duration; } } + if (matroska->ctx->strict_std_compliance >= FF_COMPLIANCE_STRICT && + (!track->video.pixel_width || !track->video.pixel_height)) + return AVERROR_INVALIDDATA; if (track->video.pixel_cropl >= INT_MAX - track->video.pixel_cropr || track->video.pixel_cropt >= INT_MAX - track->video.pixel_cropb || - (track->video.pixel_cropl + track->video.pixel_cropr) >= track->video.pixel_width || - (track->video.pixel_cropt + track->video.pixel_cropb) >= track->video.pixel_height) + (track->video.pixel_cropl + track->video.pixel_cropr) >= track->video.pixel_width + !track->video.pixel_width || + (track->video.pixel_cropt + track->video.pixel_cropb) >= track->video.pixel_height + !track->video.pixel_height) return AVERROR_INVALIDDATA; track->video.cropped_width = track->video.pixel_width - track->video.pixel_cropl - track->video.pixel_cropr; -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org