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 338881 - rsvg_handle_fill_with_data should not assert that data_len != 0
rsvg_handle_fill_with_data should not assert that data_len != 0
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-18 12:12 UTC by Sebastian Rittau
Modified: 2006-04-19 23:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Rittau 2006-04-18 12:12:17 UTC
rsvg_handle_new_from_data (or more specifically rsvg_handle_fill_with_data) asserts that data_len != 0. This complicates application and language binding programming. Now each application that wants to open a SVG file from an arbitrary source (like a file or network stream) using this method must check whether the data length is bigger than zero. Especially in the case of language bindings this is unfortunate. The language binding has to check whether data length is not zero. If it is the language binding either has to throw a custom exception (so the application using the language binding has to handle one more exception) or guess what exception librsvg would throw on invalid data and use that.

I propose just returning the usual "invalid data" error in the case of data_len == 0, since it eases everybody's life.
Comment 1 Dominic Lachowicz 2006-04-19 23:52:37 UTC
I've committed something to HEAD and the gnome-2-14 branch that should make your life easier.