1 Star 0 Fork 25

sun_hai/cairo

forked from src-openEuler/cairo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-cairo-truetype-reverse-cmap-detected-memory-leaks.patch 993 Bytes
一键复制 编辑 原始数据 按行查看 历史
sun_hai 提交于 2023-06-14 16:56 . fix fuzzers
From 1f39cb2e344ddaac89da743a926d06c60e08614b Mon Sep 17 00:00:00 2001
From: sun_hai_10 <sunhai10@huawei.com>
Date: Wed, 14 Jun 2023 15:37:22 +0800
Subject: [PATCH] cairo truetype reverse cmap detected memory leaks
---
src/cairo-truetype-subset.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index 6cef4ee..472294f 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -1311,8 +1311,10 @@ _cairo_truetype_reverse_cmap (cairo_scaled_font_t *scaled_font,
/* A Format 4 cmap contains 8 uint16_t numbers and 4 arrays of
* uint16_t each num_segments long. */
- if (size < (8 + 4*num_segments)*sizeof(uint16_t))
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (size < (8 + 4*num_segments)*sizeof(uint16_t)) {
+ status = CAIRO_INT_STATUS_UNSUPPORTED;
+ goto fail;
+ }
end_code = map->endCount;
start_code = &(end_code[num_segments + 1]);
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sun_hai_10/cairo.git
git@gitee.com:sun_hai_10/cairo.git
sun_hai_10
cairo
cairo
master

搜索帮助