[cairo-commit] 2 commits - src/cairo-cff-subset.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 20 22:24:07 UTC 2023


 src/cairo-cff-subset.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 0560aa581905726ca525583d44f021cdd13739d8
Merge: 48a446663 9a2385d41
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Thu Jul 20 22:24:05 2023 +0000

    Merge branch 'master' into 'master'
    
    fix read memory access
    
    See merge request cairo/cairo!496

commit 9a2385d412da7abbd8e22c011115fe75afd1a6ec
Author: iasunsea <iasunsea at sina.com>
Date:   Fri Jul 21 00:37:33 2023 +0800

    fix read memory access

diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index 2dc64f393..b1c665daa 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -1185,6 +1185,8 @@ cairo_cff_font_read_top_dict (cairo_cff_font_t *font)
         goto fail;
 
     element = _cairo_array_index (&index, 0);
+    if (element == NULL)
+        return CAIRO_STATUS_NO_MEMORY;
     status = cff_dict_read (font->top_dict, element->data, element->length);
     if (unlikely (status))
         goto fail;
@@ -3128,6 +3130,8 @@ _cairo_cff_scaled_font_is_cid_cff (cairo_scaled_font_t *scaled_font)
 	goto fail2;
 
     element = _cairo_array_index (&index, 0);
+    if (element == NULL)
+        goto fail3;
     status = cff_dict_read (top_dict, element->data, element->length);
     if (unlikely (status))
         goto fail3;


More information about the cairo-commit mailing list