[PATCH 5/6] usp10: Use heap_calloc() in SHAPE_does_GSUB_feature_apply_to_chars().

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 5/6] usp10: Use heap_calloc() in SHAPE_does_GSUB_feature_apply_to_chars().

Henri Verbeet-2
Signed-off-by: Henri Verbeet <[hidden email]>
---
 dlls/usp10/shape.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index ca084e7285f..40313863002 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -712,13 +712,14 @@ static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
         psc->GDEF_Table = load_gdef_table(hdc);
 }
 
-INT SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, const WCHAR *chars, INT write_dir, INT count, const char* feature)
+int SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
+        const WCHAR *chars, int write_dir, int count, const char *feature)
 {
     WORD *glyphs;
     INT glyph_count = count;
     INT rc;
 
-    glyphs = heap_alloc(2 * count * sizeof(*glyphs));
+    glyphs = heap_calloc(count, 2 * sizeof(*glyphs));
     GetGlyphIndicesW(hdc, chars, count, glyphs, 0);
     rc = apply_GSUB_feature_to_glyph(hdc, psa, psc, glyphs, 0, write_dir, &glyph_count, feature);
     if (rc > GSUB_E_NOGLYPH)
--
2.11.0



Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 5/6] usp10: Use heap_calloc() in SHAPE_does_GSUB_feature_apply_to_chars().

Aric Stewart
Signed-off-by: Aric Stewart <[hidden email]>

On 3/13/18 5:23 AM, Henri Verbeet wrote:

> Signed-off-by: Henri Verbeet <[hidden email]>
> ---
>   dlls/usp10/shape.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
> index ca084e7285f..40313863002 100644
> --- a/dlls/usp10/shape.c
> +++ b/dlls/usp10/shape.c
> @@ -712,13 +712,14 @@ static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
>           psc->GDEF_Table = load_gdef_table(hdc);
>   }
>  
> -INT SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, const WCHAR *chars, INT write_dir, INT count, const char* feature)
> +int SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
> +        const WCHAR *chars, int write_dir, int count, const char *feature)
>   {
>       WORD *glyphs;
>       INT glyph_count = count;
>       INT rc;
>  
> -    glyphs = heap_alloc(2 * count * sizeof(*glyphs));
> +    glyphs = heap_calloc(count, 2 * sizeof(*glyphs));
>       GetGlyphIndicesW(hdc, chars, count, glyphs, 0);
>       rc = apply_GSUB_feature_to_glyph(hdc, psa, psc, glyphs, 0, write_dir, &glyph_count, feature);
>       if (rc > GSUB_E_NOGLYPH)
>