Missing argument defs cause segfaults

Submitted by Lawrence D'Oliveiro on April 19, 2017, 1:22 a.m.

Details

Message ID 20170419132218.037ce77b@theon.geek-central.gen.nz
State New
Series "Missing argument defs cause segfaults"
Headers show

Commit Message

Lawrence D'Oliveiro April 19, 2017, 1:22 a.m.
The cookbook example of how to call FreeType using ctypes is missing
the argtypes definition for cairo_font_face_get_user_data. This will
cause segfaults.

Enclosed is a fix.

Patch hide | download patch | download mbox

commit 03559f851898195868cf218905129000c5ca8d16
Author: Lawrence D'Oliveiro <ldo@geek-central.gen.nz>
Date:   Wed Apr 19 01:20:03 2017 +0000

    missing argument defs cause segfault

diff --git a/src/cookbook/freetypepython.mdwn b/src/cookbook/freetypepython.mdwn
index 5aea77f..83f71d5 100644
--- a/src/cookbook/freetypepython.mdwn
+++ b/src/cookbook/freetypepython.mdwn
@@ -32,6 +32,7 @@  The resulting cairo font face however can be used normally with pycairo.
 			_cairo_so.cairo_ft_font_face_create_for_ft_face.restype = ct.c_void_p
 			_cairo_so.cairo_ft_font_face_create_for_ft_face.argtypes = [ ct.c_void_p, ct.c_int ]
 			_cairo_so.cairo_font_face_get_user_data.restype = ct.c_void_p
+			_cairo_so.cairo_font_face_get_user_data.argtypes = (ct.c_void_p, ct.c_void_p)
 			_cairo_so.cairo_font_face_set_user_data.argtypes = (ct.c_void_p, ct.c_void_p, ct.c_void_p, ct.c_void_p)
 			_cairo_so.cairo_set_font_face.argtypes = [ ct.c_void_p, ct.c_void_p ]
 			_cairo_so.cairo_font_face_status.argtypes = [ ct.c_void_p ]