From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 2F3DF43244 for ; Wed, 25 May 2022 16:10:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1C26568B552; Wed, 25 May 2022 19:10:23 +0300 (EEST) Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1B96568AA68 for ; Wed, 25 May 2022 19:10:17 +0300 (EEST) Received: by mail-qv1-f44.google.com with SMTP id b11so8111784qvv.4 for ; Wed, 25 May 2022 09:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yKvRYzwBMGsArHWyaw3N9BX8Ol6PeH8oXysXZxJxk28=; b=cCEPoHwqDjXPg38Hjwzgx7CnKc5x+WOg1LyzIOo7WSodd4BY3WxtBHGurc6CaoWjpG YsUiah6dWpCjMeLVYl4k9Qpd0rKPb1ugnNk0e9i84w3MurTirOro3F91cRmWpvl4Hnyf gxSWZS6v4wzmPivsfqNvYvnEzuZWPpVHJ55VdxPOIr0hFzHCgyUmoQOaOltrYorepsWk 7kl60GOi/I6CIXMaSjaYlOgGM1c1o4fFLguyjcaWIBBs6h5Ng5SuaTVGAcZe2HN6XNCg rHPFQnuQ1LlFWfKv7XrlwGivehb8yYq72gmnN+GEi8nV0mv6LeZZVj+cavrWJgoEg4uZ yJxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yKvRYzwBMGsArHWyaw3N9BX8Ol6PeH8oXysXZxJxk28=; b=uLwMIVEiLt9fB1hAjU0CWv/bU2ASArrqQ1weoFVpAjU/OijaUmZOoQ+ZpGT+xCddJ0 alyqDC4XTeDChEOOulNrT8Mu4YsvFFvvygRS17s6/+nPsU+zqY1dz8+kwjCS9EFYwYjE H5FCwCbZQbG+jpp9v76mTX9ARGB9cmSwbZGpJ80OSn2+l2FV1//NALA8VE7DTPZOIOUy NsjVU9oMwrRRauJy2LwpsLoOkCscicH8h8dJYwE+fNcnrLhbtMpcV4GheioWSfLc+wH6 ATRvttEWOvkwDPF9+EGkU1fcFGlAVQlnoa3nnXr/9sLVdoFkdj3HXdU+BotNoiaD213E J82Q== X-Gm-Message-State: AOAM530MJtNmEdqzujHFVnBv0Lk/gYaH8/KK8uzuadW00zCi1F3HMkYV Ry3ZcwH5igWLlt+ptp5Z89iTt/58Nb4z2Q== X-Google-Smtp-Source: ABdhPJwuc2xSM14KLXIKchuMpuSGDoql6sF9Lm+adS3/tCDL5aF2K0YCJKekb8dvkK2a8KETd5hmcw== X-Received: by 2002:a05:6214:29e4:b0:45b:f666:d3d3 with SMTP id jv4-20020a05621429e400b0045bf666d3d3mr27230809qvb.120.1653495015424; Wed, 25 May 2022 09:10:15 -0700 (PDT) Received: from gauss.local (c-68-41-54-207.hsd1.mi.comcast.net. [68.41.54.207]) by smtp.gmail.com with ESMTPSA id p6-20020a05620a22e600b0069fc13ce250sm1369138qki.129.2022.05.25.09.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 09:10:15 -0700 (PDT) From: Leo Izen To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 May 2022 12:10:12 -0400 Message-Id: <20220525161012.1077373-1-leo.izen@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] avformat/jpegxl_probe: fix incorrect cw_mask and extensions probing 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: Leo Izen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: - Fix incorrectly skipping over the upX_weights if the cw_mask is present and it is not a multiple of 4. - Fix not skipping over the extensions payload if an extension is present. --- libavformat/jpegxl_probe.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libavformat/jpegxl_probe.c b/libavformat/jpegxl_probe.c index 9cd00da194..b5aac4869b 100644 --- a/libavformat/jpegxl_probe.c +++ b/libavformat/jpegxl_probe.c @@ -359,24 +359,31 @@ int ff_jpegxl_verify_codestream_header(const uint8_t *buf, int buflen) extensions = jxl_u64(); if (extensions) { + uint64_t extensions_len = 0; for (int i = 0; i < 64; i++) { if (extensions & (UINT64_C(1) << i)) - jxl_u64(); + extensions_len += jxl_u64(); } + if (extensions_len) + jxl_bits_skip(extensions_len); } } /* default transform */ if (!jxl_bits(1)) { + uint32_t cw_mask; + /* opsin inverse matrix */ if (xyb_encoded && !jxl_bits(1)) jxl_bits_skip(16 * 16); + /* cw_mask and default weights */ - if (jxl_bits(1)) + cw_mask = jxl_bits(3); + if (cw_mask & 1) jxl_bits_skip(16 * 15); - if (jxl_bits(1)) + if (cw_mask & 2) jxl_bits_skip(16 * 55); - if (jxl_bits(1)) + if (cw_mask & 4) jxl_bits_skip(16 * 210); } -- 2.36.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".