From patchwork Mon Jan 29 23:27:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 45893 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:8786:b0:199:de12:6fa6 with SMTP id ph6csp1839919pzb; Mon, 29 Jan 2024 15:28:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0s3bZ91F9fspF78vyvVofa59z2T2EY88WHL9eq9UCfQ283dakwrQHkwGR+uVn13tTmsHG X-Received: by 2002:a17:906:3913:b0:a35:34a7:af1d with SMTP id f19-20020a170906391300b00a3534a7af1dmr5162006eje.13.1706570892561; Mon, 29 Jan 2024 15:28:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706570892; cv=none; d=google.com; s=arc-20160816; b=wxf1VoSa6OigaXJfzS3mo1LjT63UJxywkhAM1eWS2YLWPYYVV7VPzKvCthrmBkH41D 9b/EsuVFeXaagvFShpX+8APLVbcNVYCaJXr3qGwOl/hL7iw0nwX9VXNMtQH/7/okP2lS 3F3/gKZAm6GMGhnV//tenJnkMQkhMh05TZgaGXc4tyvRNGAfmglBAknXNXkl1m1cQB2L 7dUH7eBaxYsHnR7Mb4CNBygrpWy41e0SQ177gLjq8I5wqJTUsU9zgM6myZPsqNSsFvIq qytGvjUfXWOcZr4yoyKbwtSdm6uvRvflX21ANghLQvjaqgBR++KFGE2+t0M6oZF9f0eS 8w6w== 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=16NtmJU3Eq1CaBRSFdVuAZd+zUFW2H9aV+iav7wSRMU=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=ooUh8cBx6Hp8VMPODdvzjU6zv1WQFbVcHZU5R6au+BOeDCj3sy7e79NRBGovEbbSt9 HzBVtnNwZbUpndN76CVzw97Sj/QQ8dDwuoPBHyRnRlCvAkV26pvGM/OpO712Fk/tn75S 9jTV4FXG/vZYir+6ikX0l8Rpce5d4cOOw4mPMmhdvaP4d3+0xADlmQ9uik22r3b3sGqF bNt5kPYh0STXA5TyHziOCYdyOJ4hWQn6rWKAmX2YCmRFaGMGk46JOGwCYnxQ0sERai2L Fn2PisyQMgIdTz0hKxKAHtzpPcWjz+m9UwXEkobH6d4LYxNyzjCCx20siKFSASGbnvcr Uazg== 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 l13-20020a17090612cd00b00a35a4074919si1665260ejb.450.2024.01.29.15.28.12; Mon, 29 Jan 2024 15:28:12 -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 5DE1768D286; Tue, 30 Jan 2024 01:28:09 +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 7945F68D22F for ; Tue, 30 Jan 2024 01:28:02 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 15891E9CAA; Tue, 30 Jan 2024 00:28:02 +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 ZeBJlGaaVeUh; Tue, 30 Jan 2024 00:28:00 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id CBEADE95E9; Tue, 30 Jan 2024 00:27:59 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 30 Jan 2024 00:27:51 +0100 Message-Id: <20240129232755.9622-1-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avformat/mov_chan: do not assume channels are in native order 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: pMAF63UCPn+E Existing code could have caused wrong channel order signalling or reduced channel count if a channel designation appeared multiple times. This is actually an old bug, but the conversion to the new channel layout API made it visible, because now the code overrides the proper channel count with the one calculated from the mask. Signed-off-by: Marton Balint --- libavformat/mov_chan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c index f3d51899e1..5cb2de3820 100644 --- a/libavformat/mov_chan.c +++ b/libavformat/mov_chan.c @@ -530,7 +530,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st, size -= 20; if (layout_tag == 0) { uint64_t mask_incr = mov_get_channel_mask(label); - if (mask_incr == 0) { + if (mask_incr == 0 || mask_incr <= label_mask) { label_mask = 0; break; }