summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@chown.ath.cx>2016-10-04 02:35:26 +0200
committerGrigori Goronzy <greg@chown.ath.cx>2016-10-04 19:45:07 +0200
commitaa54e0b59200a994d50a346b5d7ac818ebcf2d4b (patch)
tree3e0cf464e3d9a46bf10f23ddeb261693edc2613d
parent16d8d586d5aa4c4501ff092668e73b405821abb6 (diff)
downloadlibass-aa54e0b59200a994d50a346b5d7ac818ebcf2d4b.tar.bz2
libass-aa54e0b59200a994d50a346b5d7ac818ebcf2d4b.tar.xz
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.
-rw-r--r--libass/ass_shaper.c1
1 files changed, 1 insertions, 0 deletions
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;
}