GNOME Bugzilla – Bug 338881
rsvg_handle_fill_with_data should not assert that data_len != 0
Last modified: 2006-04-19 23:52:37 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.
I've committed something to HEAD and the gnome-2-14 branch that should make your life easier.