We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c828124 commit 81106abCopy full SHA for 81106ab
1 file changed
cairo/surface.c
@@ -1042,6 +1042,11 @@ image_surface_get_data (PycairoImageSurface *o, PyObject *ignored) {
1042
1043
buffer = cairo_image_surface_get_data (surface);
1044
if (buffer == NULL) {
1045
+ // It's documented to return NULL after finish, but that's not always the case:
1046
+ // https://gitlab.freedesktop.org/cairo/cairo/-/issues/406
1047
+ // and it returns NULL if the size is 0 and it's backed by pixman:
1048
+ // https://gitlab.freedesktop.org/cairo/cairo/-/issues/880
1049
+ // Let's paper over this by returning an empty memoryview.
1050
return create_empty_memoryview();
1051
}
1052
height = cairo_image_surface_get_height (surface);
0 commit comments