[pango/add-null-checkds] Add some NULL checks
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/add-null-checkds] Add some NULL checks
- Date: Sun, 9 May 2021 04:47:01 +0000 (UTC)
commit 7b3182a3b5427137557d257f7024a5078a096fc3
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 9 00:45:31 2021 -0400
Add some NULL checks
Originally suggested by Philipp Withnall in
https://bugzilla.gnome.org/show_bug.cgi?id=778655
Fixes: #268
pango/pangocoretext-fontmap.c | 3 ++-
pango/pangofc-fontmap.c | 3 ++-
pango/pangowin32-fontmap.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c
index 09437b4a..81bf7bf7 100644
--- a/pango/pangocoretext-fontmap.c
+++ b/pango/pangocoretext-fontmap.c
@@ -529,7 +529,8 @@ pango_core_text_face_list_sizes (PangoFontFace *face,
int *n_sizes)
{
*n_sizes = 0;
- *sizes = NULL;
+ if (sizes)
+ *sizes = NULL;
}
G_DEFINE_TYPE (PangoCoreTextFace, pango_core_text_face, PANGO_TYPE_FONT_FACE);
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 7966a8cd..f74b2c15 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -2904,7 +2904,8 @@ pango_fc_face_list_sizes (PangoFontFace *face,
FcObjectSet *objectset;
FcFontSet *fonts;
- *sizes = NULL;
+ if (sizes)
+ *sizes = NULL;
*n_sizes = 0;
if (G_UNLIKELY (!fcface->family || !fcface->family->fontmap))
return;
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c
index e5e81bba..18d4544e 100644
--- a/pango/pangowin32-fontmap.c
+++ b/pango/pangowin32-fontmap.c
@@ -1794,7 +1794,8 @@ pango_win32_face_list_sizes (PangoFontFace *face,
* for scalable fonts it's simple, and currently we only have such
* see : pango_win32_enum_proc(), TRUETYPE_FONTTYPE
*/
- *sizes = NULL;
+ if (sizes)
+ *sizes = NULL;
*n_sizes = 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]