cairo: fix segv cause by bad image stream

bug 76445