After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 613678 - Lots of endian issues in librsvg
Lots of endian issues in librsvg
Status: RESOLVED OBSOLETE
Product: librsvg
Classification: Core
Component: general
2.26.x
Other other
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-23 11:00 UTC by andreas
Modified: 2017-12-13 17:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixed rsvg-filter.c (130.94 KB, text/x-c)
2010-03-23 11:00 UTC, andreas
Details
Fixed rsvg-cairo-draw.c (33.84 KB, text/x-c)
2010-03-23 11:01 UTC, andreas
Details

Description andreas 2010-03-23 11:00:39 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.
Comment 1 andreas 2010-03-23 11:01:08 UTC
Created attachment 156848 [details]
Fixed rsvg-cairo-draw.c
Comment 2 Christian Persch 2010-03-23 12:58:30 UTC
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.
Comment 3 Christian Persch 2011-09-06 11:52:35 UTC
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
+       );
Comment 4 GNOME Infrastructure Team 2017-12-13 17:38:28 UTC
-- 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.