From ad46070e421a02cb7aaf6b81b11b4ba33d403b3c Mon Sep 17 00:00:00 2001 From: Ulf Jasper Date: Wed, 17 Dec 2014 22:00:22 +0100 Subject: [PATCH] Fixed problems with svg_load_image -- no more crashes (hopefully) * src/image.c (svg_load): Watch out for nil value of current buffer's filename. Re-enable filename thing for not-a-file case. --- src/ChangeLog | 5 +++++ src/image.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 455ec1e8387..3854803d843 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-12-17 Ulf Jasper + + * image.c (svg_load): Watch out for nil value of current buffer's + filename. Re-enable filename thing for not-a-file case. + 2014-12-17 Ulf Jasper Partially disabled previous change. diff --git a/src/image.c b/src/image.c index 954d66424d1..ceec3ce46b1 100644 --- a/src/image.c +++ b/src/image.c @@ -8823,10 +8823,9 @@ svg_load (struct frame *f, struct image *img) return 0; } original_filename = BVAR (current_buffer, filename); - /* FIXME: disabled the filename thing for the time being as it - can cause crashs. */ success_p = svg_load_image (f, img, SDATA (data), SBYTES (data), - NULL /* SDATA(original_filename) */); + NILP(original_filename) ? + NULL : SDATA(original_filename)); } return success_p; -- 2.39.2