From 7b4c9284a91a8cc1dcb84f7008c82229995f6d89 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Wed, 12 Jan 2022 11:35:31 +0900 Subject: [PATCH] vg_common_svg: Fix when the number of polygon points is odd Summary: If the number of points is odd, an overflow occurs in array[i+1]. Test Plan: Test Svg image ``` Not enough points Must contain at least 4 points ``` Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12319 --- src/static_libs/vg_common/vg_common_svg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index d75486ed58..6efef669d6 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -832,7 +832,7 @@ _add_polyline(Efl_VG *vg, double *array, int size, Eina_Bool polygon) if (size < 2) return; efl_gfx_path_append_move_to(vg, array[0], array[1]); - for (i=2; i < size; i+=2) + for (i = 2; i < size - 1; i += 2) efl_gfx_path_append_line_to(vg, array[i], array[i+1]); if (polygon)