From: gnome-perl (bugzilla.gnome.o. <bug...@gn...> - 2011-01-14 19:50:50
|
https://bugzilla.gnome.org/show_bug.cgi?id=639558 gnome-perl | Gtk2 | unspecified Summary: Pixbuf new_from_data() vs overload Classification: Bindings Product: gnome-perl Version: unspecified OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: Normal Component: Gtk2 AssignedTo: gtk...@li... ReportedBy: us...@zi... QAContact: gtk...@li... GNOME target: --- GNOME version: --- Created an attachment (id=178349) View: https://bugzilla.gnome.org/attachment.cgi?id=178349 Review: https://bugzilla.gnome.org/review?bug=639558&attachment=178349 patch and test case Is there a reason Gtk2::Gdk::Pixbuf->new_from_data() demands SvPOK of its data input? I thought it might SvPV to stringize in the usual way. Doing so would allow overloads and magic to work there the same way as they do elsewhere. (It normally seems like a bad idea to enquire into the nature of a scalar. For a string ask for a string and let perl worry how to get it :-) Possible simplification below, copying out the SvPV data into a malloced block for the pixbuf data area rather than an newSVsv. (I plan also to check the length of the input, to see the given width*height and rowstride won't overrun the data area. That would be with or without this change. Maybe SvPVbytes too if it unmangles any 0x80 to 0xFF wide chars, and/or guards against chars 0x100 up.) -- Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. |