From 613806fb9e64f212d1959486665e502c2f2111f8 Mon Sep 17 00:00:00 2001 From: XJTUxuyun Date: Sat, 10 Aug 2024 18:22:11 +0800 Subject: [PATCH] Update emf2svg_utils.c fix segment fault bug, reason is gindex great than rmap_s --- src/lib/emf2svg_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/emf2svg_utils.c b/src/lib/emf2svg_utils.c index fe778b0d..6e11d4ee 100644 --- a/src/lib/emf2svg_utils.c +++ b/src/lib/emf2svg_utils.c @@ -1127,7 +1127,7 @@ static int cmap_rev(const char *fpath, cmap_collection *rcmap) { while (gindex != 0) { if (gindex >= rmap_s) { int old_rmap_s = rmap_s; - rmap_s += 1000; + rmap_s = gindex + 1000; uint32_t *tmp = realloc(rcmap->uni, sizeof(uint32_t) * rmap_s); for (int i = old_rmap_s; i < rmap_s; i++) tmp[i] = 0;