There's invalid check in cairo-surface.c, which checks for (!surface), but
on failure nil surface is always returned.
Attached a simple patch which fixes this issue.
Created attachment 8577 [details] [review]
patch which fixes cairo crash
Thanks for the report. I've made an alternate fix here which I'd love for you to give a try:
This is already available in a git pull of 1.3.15 and will be in 1.4.0 as well.
Also, if you could tell me what you were doing to get which backend to return a nil surface from create_similar, I'd love to add something to a test case to exercise this situation.
Unfortunatelly, the bug still exists in 1.4.0. Attached the patch that fixes it.
Created attachment 9179 [details] [review]
A patch that fixes bug in 1.4.0
Here is a patch that fixes crash while creating surface with negative width
(In reply to comment #3)
> Unfortunatelly, the bug still exists in 1.4.0. Attached the patch that fixes
Sorry we missed the fix.
Again, as I asked before, do you have a test case that we can use to exercise the bug so that we can be sure we've actually fixed it and that we don't keep regressing here?
Ok, I've pushed out another fix for this (will be in 1.4.2):
It's slightly different, but hopefully still solves the problem,
(again, I'm still waiting for a test case to demonstrate the bug).
Created attachment 9225 [details]
A test case
A test case, which fails on unpatched cairo, but works on patched one