From aa54e0b59200a994d50a346b5d7ac818ebcf2d4b Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Tue, 4 Oct 2016 02:35:26 +0200 Subject: shaper: fix reallocation Update the variable that tracks the allocated size. This potentially improves performance and avoid some side effects, which lead to undefined behavior in some cases. Fixes fuzzer test case id:000051,sig:11,sync:fuzzer3,src:004221. --- libass/ass_shaper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c index 2707b23..5f24c5a 100644 --- a/libass/ass_shaper.c +++ b/libass/ass_shaper.c @@ -100,6 +100,7 @@ static bool check_allocations(ASS_Shaper *shaper, size_t new_size) !ASS_REALLOC_ARRAY(shaper->emblevels, new_size) || !ASS_REALLOC_ARRAY(shaper->cmap, new_size)) return false; + shaper->n_glyphs = new_size; } return true; } -- cgit v1.2.3