代码拉取完成,页面将自动刷新
同步操作将从 openEuler-RISC-V/jasper 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 03db7c81f6a8a92d896249bc673877749987fd7a Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Wed, 24 Jun 2020 21:26:10 +0200
Subject: [PATCH] jp2_enc: check number of components before dereferencing them
Fixes CVE-2018-20570
Closes https://github.com/jasper-maint/jasper/issues/11
Closes https://github.com/mdadams/jasper/issues/191
---
src/libjasper/jp2/jp2_enc.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/libjasper/jp2/jp2_enc.c b/src/libjasper/jp2/jp2_enc.c
index fd39a84..1b44c18 100644
--- a/src/libjasper/jp2/jp2_enc.c
+++ b/src/libjasper/jp2/jp2_enc.c
@@ -293,7 +293,8 @@ int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr)
needcdef = 1;
switch (jas_clrspc_fam(jas_image_clrspc(image))) {
case JAS_CLRSPC_FAM_RGB:
- if (jas_image_cmpttype(image, 0) ==
+ if (jas_image_numcmpts(image) >= 3 &&
+ jas_image_cmpttype(image, 0) ==
JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R) &&
jas_image_cmpttype(image, 1) ==
JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G) &&
@@ -302,7 +303,8 @@ int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr)
needcdef = 0;
break;
case JAS_CLRSPC_FAM_YCBCR:
- if (jas_image_cmpttype(image, 0) ==
+ if (jas_image_numcmpts(image) >= 3 &&
+ jas_image_cmpttype(image, 0) ==
JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_Y) &&
jas_image_cmpttype(image, 1) ==
JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CB) &&
@@ -311,7 +313,8 @@ int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr)
needcdef = 0;
break;
case JAS_CLRSPC_FAM_GRAY:
- if (jas_image_cmpttype(image, 0) ==
+ if (jas_image_numcmpts(image) >= 1 &&
+ jas_image_cmpttype(image, 0) ==
JAS_IMAGE_CT_COLOR(JAS_IMAGE_CT_GRAY_Y))
needcdef = 0;
break;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。