From patchwork Tue Aug 27 12:52:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 51185 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:c944:0:b0:48e:c0f8:d0de with SMTP id k4csp409852vqt; Tue, 27 Aug 2024 10:40:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXIxXaysA8pTI8N4+XgsBcEpMRVfsCAS1lMBs4tgBtDjt214raWbX1vQcTW9V6zIrpmI0/g/YcktGLq08ornKt+@gmail.com X-Google-Smtp-Source: AGHT+IGDrcd0YB2gONh10KCQ9MqsEahik428meDp9vpaKPcKgXJZsunVBfmqL/lvneU5gczEfWdM X-Received: by 2002:a05:6402:50cf:b0:599:b77c:7d86 with SMTP id 4fb4d7f45d1cf-5c0891c59a6mr5272110a12.5.1724780417274; Tue, 27 Aug 2024 10:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724780417; cv=none; d=google.com; s=arc-20240605; b=DX1WG3CNN78sQQzlYkTNRu2ie0hhvdGhgxP9md5U18OF+ybyZU7MRV3xHOcfM5SPYf /l06Lhj53LqEqk6rX7ftW78YPI746rkA94zzTU4i7sv2g4sq/Say0Ym8NHCLmD2OxgIW pFH+te5F3tArwhVu3jFFd0NuZb9BwGW+3xj5hUgsZe71prgA1uik8ue0iPN0bLMg6oU3 jhP93d6N7QhmwEk265tWn0Zu0JwlSS1Z8mmn0eNDpSFeAagqyNmclBb799qu4YpPQ/zH uoPGtlfZA1treT01K4aFAIbbDsjL7Q0ueg9G6blgw2Ws4jQnZ6pEEBCcHc82aVI0A3Vc FRCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=3lrQCm6AAXg5dp0N/Jd2m9Bvx7d64CBe1uhmUjxXRwo=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=fuJWCwzqe73bt2mS8BX83zucl51nkgZFZndOgcvn/u1JDGaEaEzSJqmg1M1lKoOewR vaSaZqGIwTLprFYD3XrXTHDHvLCPNj2iiqQcmaoOA44fJeAosUL+cY+D5d5jXdnpRweU 4pmdTEbASPyw1tJqvvAhzdqYB+Hfm3ecxGNGGaVes+nZBblkddzMSGH1+2o7KHhA0w/Q KxpkEndqa0ZjoMEYS/cWRJ0oh0whXVQFoSBOnauim3pj2DuxzrkSt0dnnKZ5AnW/wfTu xer1g+unF6vsZV+CLHPFQpoYe/3bsWXqNPz/Hw67LT7B8vbx77ZpEKoNxbC9Po1l/K2I nMug==; 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=DRLIl061; 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; dara=fail header.i=@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 4fb4d7f45d1cf-5c0bb1cc120si1729156a12.7.2024.08.27.10.40.16; Tue, 27 Aug 2024 10:40:17 -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=DRLIl061; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6F39A68DBC2; Tue, 27 Aug 2024 15:52:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A975268DAB6 for ; Tue, 27 Aug 2024 15:52:08 +0300 (EEST) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-71434174201so4484988b3a.0 for ; Tue, 27 Aug 2024 05:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724763126; x=1725367926; 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=6K/MvX6GL4bnPmT636M1+n2chk0fUOOKrp8iTZWQOBE=; b=DRLIl061y05ZvJtVhF0WRwXrKqlWoN0F/AKupuPOU1bzdOOUxaW5H3jaWpfd5svMX2 pFB7ydgBCLS0mQEbcZSIMjAURq+ABrhlf/uEDMjKXz/qsjQWY/J47agLu7zpoh5JjSK8 28972msjwZ0cxYS5/8iwy8Xzdl90Jf0DH7EjwVKRpaIGbg2WJnsPR1L2/F8dp14c6ZcZ Bt+Kuk5eHwKTGOaXlxGDXNj18YiABKTGqDbKEOVYhyuqBd6POH/NRWbzT4+fhcrGu4CU 22hRKvuZtYZyW6Sw3sByd/QhbK5C583kAfE26Ns588iRHhJipf7iV1q5kwKgXVVu6wju fz9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724763126; x=1725367926; 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=6K/MvX6GL4bnPmT636M1+n2chk0fUOOKrp8iTZWQOBE=; b=PNACzFtm+3na1YVuyVmVWISrEzs1Ync2c2NLnrR1CaxS4zW/lwTIdgxKR+gbXPUIl8 Kow2PvP2iK6oC1EvGMev/6QBSoc8ELCccClRrvqXeoeOakp+5fDaYkxxx0BFRDL1tFGD HSuYCAeI8vP6MY07uet2NYVJrNN3yCOwvjaA+Eba3T/MtBUEHNU+0b6111l5j/Edu6k9 6TthUZZioneHEXWlNZ9vFXyiSdl+G2u6xZIGIhX+J6Al99pOc+jDkko5Cb3i7uH/J1NY 4X6ToWxsNiSPIFY0xX0bVc3YmJVkQkCdbWuy1Q0BhGdzBEFNtNFYsQZxBuT1hnn6VTBb Nv1w== X-Gm-Message-State: AOJu0Yw7BwSMRXYVWRJASWDX4dlJk0X/g2nDlTYC/4YTFFFd44PDO0Eo uryzm8abfYvhXMDLOJF1Mp6uYnpXchTK633zkKHMm0pqIy+GbtvWUpTWPg== X-Received: by 2002:a05:6a00:3d4e:b0:714:1631:a7d4 with SMTP id d2e1a72fcca58-715c00018abmr3512251b3a.16.1724763126019; Tue, 27 Aug 2024 05:52:06 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7143431052bsm8514329b3a.181.2024.08.27.05.52.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 05:52:05 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Aug 2024 09:52:36 -0300 Message-ID: <20240827125237.56-1-jamrial@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/cbs_h265: fix valid range for {left, right}_view_id 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: OLuCzVDd3aP7 view_id_len in VPS is 4 bits, so view_id values can be up to 15 bits long. Signed-off-by: James Almer --- libavcodec/cbs_h265.h | 4 ++-- libavcodec/cbs_h265_syntax_template.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h index 892a35bd22..eec4bf0825 100644 --- a/libavcodec/cbs_h265.h +++ b/libavcodec/cbs_h265.h @@ -725,8 +725,8 @@ typedef struct H265RawSEI3DReferenceDisplaysInfo { uint8_t ref_viewing_distance_flag; uint8_t prec_ref_viewing_dist; uint8_t num_ref_displays_minus1; - uint8_t left_view_id[31]; - uint8_t right_view_id[31]; + uint16_t left_view_id[31]; + uint16_t right_view_id[31]; uint8_t exponent_ref_display_width[31]; uint8_t mantissa_ref_display_width[31]; uint8_t exponent_ref_viewing_distance[31]; diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c index 9f0281b8e8..e2805c7ff1 100644 --- a/libavcodec/cbs_h265_syntax_template.c +++ b/libavcodec/cbs_h265_syntax_template.c @@ -2299,8 +2299,8 @@ SEI_FUNC(sei_3d_reference_displays_info, (CodedBitstreamContext *ctx, RWContext ue(prec_ref_viewing_dist, 0, 31); ue(num_ref_displays_minus1, 0, 31); for (i = 0; i <= current->num_ref_displays_minus1; i++) { - ues(left_view_id[i], 0, UINT8_MAX, 1, i); - ues(right_view_id[i], 0, UINT8_MAX, 1, i); + ues(left_view_id[i], 0, MAX_UINT_BITS(15), 1, i); + ues(right_view_id[i], 0, MAX_UINT_BITS(15), 1, i); us(6, exponent_ref_display_width[i], 0, 62, 1, i); if (!current->exponent_ref_display_width[i]) length = FFMAX(0, (int)current->prec_ref_display_width - 30);