GNOME Bugzilla – Bug 613678
Lots of endian issues in librsvg
Last modified: 2017-12-13 17:38:28 UTC
Created attachment 156847 [details] Fixed rsvg-filter.c I noticed that the rsvg-filter.c part of librsvg has quite a lot of endian issues. Many filters expect data to be present in BGRA byte order, but on big endian systems data will be in ARGB order, of course. I've fixed all endian issues that I came across while playing with librsvg on a PPC system. I used librsvg 2.26.0 as the base version. rsvg-cairo-draw.c also needs a fix but this is merely a single line. Here are my modified versions so someone can review the changes and include the fixes in the master version. Please note that I'm including the full versions because I don't have the tools necessary to create a diff patch.
Created attachment 156848 [details] Fixed rsvg-cairo-draw.c
It will certainly make reviewing your changes easier if you do attach diffs instead of whole files. To do so, just git clone the rsvg repo from git.gnome.org, create a local branch, commit and then use the git format-patch command.
The only actual difference I could find here was this: - output = rsvg_filter_render (state->filter, pixbuf, ctx, &render->bbox, "2103"); + output = rsvg_filter_render (state->filter, pixbuf, bg, ctx, &render->bbox, +#if G_BYTE_ORDER == G_LITTLE_ENDIAN + "2103" // BGRA +#else + "1230" // ARGB +#endif + );
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/36.