summaryrefslogtreecommitdiffstats
path: root/debian/squeeze/dependencies/libr/debian/patches/002-fix-crash-on-malformed-icon.diff
diff options
context:
space:
mode:
Diffstat (limited to 'debian/squeeze/dependencies/libr/debian/patches/002-fix-crash-on-malformed-icon.diff')
-rw-r--r--debian/squeeze/dependencies/libr/debian/patches/002-fix-crash-on-malformed-icon.diff34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/squeeze/dependencies/libr/debian/patches/002-fix-crash-on-malformed-icon.diff b/debian/squeeze/dependencies/libr/debian/patches/002-fix-crash-on-malformed-icon.diff
new file mode 100644
index 000000000..757075f0e
--- /dev/null
+++ b/debian/squeeze/dependencies/libr/debian/patches/002-fix-crash-on-malformed-icon.diff
@@ -0,0 +1,34 @@
+diff -ru libr-0.6.0~maverick/src/libr-icons.c libr-0.6.0/src/libr-icons.c
+--- libr-0.6.0~maverick/src/libr-icons.c 2011-03-02 22:22:33.000000000 +0000
++++ libr-0.6.0/src/libr-icons.c 2012-09-12 20:08:35.000000000 +0000
+@@ -330,18 +330,20 @@
+ if(entry->type == LIBR_SVG)
+ {
+ libr_icon *icon = libr_icon_geticon_byname(handle, entry->name);
+- libr_icon *icon_onecanvas;
+- char *buffer;
++ if (icon) {
++ libr_icon *icon_onecanvas;
++ char *buffer;
+
+- /* should we report the requested size for SVG? */
+- icon->icon_size = iconsize;
++ /* should we report the requested size for SVG? */
++ icon->icon_size = iconsize;
+
+- /* if the SVG is a "one canvas" document then extract the correctly sized icon */
+- if((buffer = onecanvas_geticon_bysize(icon->buffer, iconsize)) != NULL)
+- {
+- libr_icon_close(icon);
+- icon_onecanvas = new_icon_handle(LIBR_SVG, iconsize, buffer, strlen(buffer));
+- return icon_onecanvas;
++ /* if the SVG is a "one canvas" document then extract the correctly sized icon */
++ if((buffer = onecanvas_geticon_bysize(icon->buffer, iconsize)) != NULL)
++ {
++ libr_icon_close(icon);
++ icon_onecanvas = new_icon_handle(LIBR_SVG, iconsize, buffer, strlen(buffer));
++ return icon_onecanvas;
++ }
+ }
+ return icon;
+ }