From patchwork Thu May 30 00:14:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 49377 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:8f0d:0:b0:460:55fa:d5ed with SMTP id i13csp1004110vqu; Wed, 29 May 2024 17:14:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW3wmhnOxYzt3Yz5bAuVF+d732mMf0C4K+HiIJ0zNH0hdHJkxO6sT3iLuWdOwGBzdV1WZnsUR6Ry0KUWCJYw5Cbd6jmkrfGQg1log== X-Google-Smtp-Source: AGHT+IHR09fJ6/kzsbIm5f1hSrEopXpLyM1FX48z7UujYlkYRKfy3Fu5KwX835eNk/dZ6YYpwhwL X-Received: by 2002:a17:906:b188:b0:a59:cd10:9228 with SMTP id a640c23a62f3a-a65e8d365cfmr28283566b.2.1717028078890; Wed, 29 May 2024 17:14:38 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a626cc3744fsi676739166b.367.2024.05.29.17.14.38; Wed, 29 May 2024 17:14:38 -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=@outlook.com header.s=selector1 header.b="rA/7H+Pa"; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 19FFA68D410; Thu, 30 May 2024 03:14:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2077.outbound.protection.outlook.com [40.92.74.77]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4770868D233 for ; Thu, 30 May 2024 03:14:28 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TuMEr2gvA/kepIcCWYwncv8NzpLTPMmbgMv3MXnkUBNUSpW3TFZr2XFtWcDY/YOfo3U2JGIWMoS0Rb0z3Wb+RFB0U8Ms6gp/7eS7OuBcY/KoXDuNGyiDsGvfqz1jpOrMcy9SWSZORjsuVuqWfjav8WVsI3EoM+6BvebLvCYMUG07t7VRVpcj70TVDliA/BskM4etgFIrQ+yoA0yrrNL/MolxADDEv0AYAD9NlAuJSRDVTUdcf+9+7orEMDMdzIvjOmfRYSbpzf7WTLNDMJscbzj7XLF6Sim+JAztAn528eO9n1VO3gRXGFTu9frzXOmVxpyBoZ0qaIDKEAikjoGBCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ians8PvLQ47RuFJ+cVmETNgImS069NJg0vLWGsx3F4w=; b=b/lLhXqEtqB+d7m+zmW9rWfRUO1JpNtYLj2wI3j6zuWpHWqTJlAFpDKEl505Mhqy+b3G/h6tOGoEFaWf0o7B2/3XobQmpNrMDKBIxLMQMe8Ovi5DhUfs1x6SdErQuy0DB0W5F27qMazH3LNl6EdUV0PnE9TheCMDF4IYkupV0vGhiZm7knpLuCWAurqMO/Jds7+4tVWKPaCmiQrkMMzh30x/JnHjFnhczL7fA+6ACMiUQmkbtxbnhaqOwUq998cFc0VNdsIKNas9P1TRK2cv4FMJ9MdMndLtUhgvxlnUnOccUFH90QorTGM8CNvI1yyLdAO93t7KgbCYl6b4yd4fjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ians8PvLQ47RuFJ+cVmETNgImS069NJg0vLWGsx3F4w=; b=rA/7H+PaY6/EBECya9eQ87Xll94zv8vx69dzrT7x4059/628iHOizH898lbEVG33pTZIAZT+ZLlnw6kAAcfUO27UPkeOb+v9eebO1i+JqWllIpTIFtYro+LqyiWzI0fkOfrgBebOcLYPNqNCI5VG9F81UaLW7vWHFQhlC3b39i5NyHL7ov9lE7G02TGm0+jj8FhgrzZJdkGlvuX30t6LALIgKLTybBz49ZV8v5r87pvWgVdOAxo+wCEvNxeEJxNnREatSkwqQe9lgHj7g6HysiMMFh96FOUf2AGFPmKK5zDUpNWwLf3h3PZbvo56esTSJtWNDvY1Phz5qeK8NRjzxg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PR3P250MB0066.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May 2024 00:14:26 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9%4]) with mapi id 15.20.7611.025; Thu, 30 May 2024 00:14:26 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 May 2024 02:14:20 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [Y2M4KY9i1hsHK19xABIMN/W7LYGqUe0TNJ1eJWg2MEY=] X-ClientProxiedBy: FR0P281CA0127.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240530001420.3584605-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PR3P250MB0066:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c27cd03-4c1b-4d01-705c-08dc803d7755 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: DOuHv25RxBll2Cw/zZk7+DIiD4kx1lgjG0bVS+sR0TfM+HCptehBlV0lyZenkfFrGWMd/78WZ36FGWiW4WGsal8+fQ4V5quJhtR+VJds/n2edBpq9n6rPOI+CRvWb9qHDAsUWtIuKTBXlWhiI2m5dKSYGKgUfbKIobQrobUVapYplXYZ3doVgel6zDPVy3De4CL2sx/44E507imvPaa86ll0raUYKHO+IU/ySAZyxIFhN3+wKWcXrom+fvg3hU9+dHjxxRPvd3vSSgM1iyXI6j03/udfpodlCjawLa3sqKRVQZm6flLoSceXXl+j2vI0mlYbTzrStTdt8Q66dVaE8b2bXLN3RYV6g+6Jf5evZIlDAD1E6SVYXSxig5hKBFeWVhAaSn6CVwsx1tr5XM92JzT6EjpRlf784qlWTm8H/lQ5xPCZwh9rlvVtMjyZCEOIQoNxNt+3WXIgJF3zsywuM2+MHZaDkqA6v4i6cyoH0QnxPLCp2ivuhvlYuM84pE96LWHMqxxOMl6WFXbjf86F6TghpWwD++aI2Pd8Yyi2//IKvq7ixdZxtc4kAUnZhinpiEmITlKchRCs4tuSAY/bawLdfouqsdR7oChcq3IDFc7803Nq+2WnzgXWMRBQ1An8 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiS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3ONRk1gFm0cJBXREi/SVpoZmVlhnt3nvVDlyhRgsdwWgq5DEqPAQtTbAN+5h5BfzaXMQA4uN9LKxHrUqL6ESYxQt7shYFnMIopkZ/wsMnd4FDzEjccDek2c2fMpNIDIrRHtgX+KTzoDFXoXvWKbruWT9IQzsqShpFx5dnz7t70wytShR28AyFVaAr3NdyYD3YRFbR5g1Zidse70tpF2TcsVySlzQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c27cd03-4c1b-4d01-705c-08dc803d7755 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 00:14:26.4672 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P250MB0066 Subject: [FFmpeg-devel] [PATCH v3] avformat/nutdec: Don't create inconsistent side data 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: D+KL7WLwCFOy Forgotten in 65ddc74988245a01421a63c5cffa4d900c47117c. Signed-off-by: Andreas Rheinhardt --- libavformat/nutdec.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 0bb7f154db..34b7e3cb9a 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -881,8 +881,6 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int int count = ffio_read_varlen(bc); int skip_start = 0; int skip_end = 0; - int channels = 0; - int64_t channel_layout = 0; int sample_rate = 0; int width = 0; int height = 0; @@ -930,7 +928,7 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int AV_WB64(dst, v64); dst += 8; } else if (!strcmp(name, "ChannelLayout") && value_len == 8) { - channel_layout = avio_rl64(bc); + // Ignored continue; } else { av_log(s, AV_LOG_WARNING, "Unknown data %s / %s\n", name, type_str); @@ -952,7 +950,7 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int } else if (!strcmp(name, "SkipEnd")) { skip_end = value; } else if (!strcmp(name, "Channels")) { - channels = value; + // Ignored } else if (!strcmp(name, "SampleRate")) { sample_rate = value; } else if (!strcmp(name, "Width")) { @@ -965,18 +963,14 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int } } - if (channels || channel_layout || sample_rate || width || height) { - uint8_t *dst = av_packet_new_side_data(pkt, AV_PKT_DATA_PARAM_CHANGE, 28); + if (sample_rate || width || height) { + uint8_t *dst = av_packet_new_side_data(pkt, AV_PKT_DATA_PARAM_CHANGE, 16); if (!dst) return AVERROR(ENOMEM); bytestream_put_le32(&dst, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE*(!!sample_rate) + AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS*(!!(width|height)) ); - if (channels) - bytestream_put_le32(&dst, channels); - if (channel_layout) - bytestream_put_le64(&dst, channel_layout); if (sample_rate) bytestream_put_le32(&dst, sample_rate); if (width || height){