summaryrefslogtreecommitdiff
path: root/src/nsimage.m
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2010-09-04 21:39:34 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2010-09-04 21:39:34 +0200
commit7574650a39ce88088ff88acac1f734168161882b (patch)
tree9b6c14c01dadbd2105914e64fc33a150c73451fb /src/nsimage.m
parent5abf15563a3a176f46ec4bcdc602c716eb9d5737 (diff)
downloademacs-7574650a39ce88088ff88acac1f734168161882b.tar.gz
Check all lisp types in image loader
* nsimage.m (ns_load_image): Check argument types. * image.c: Remove all uses of gcpro. (xpm_load): Check all lisp types. (pbm_load): Likewise. (png_load): Likewise. (jpeg_load): Likewise. (tiff_load): Likewise. (gif_load): Likewise. (imagemagick_load_image): Likewise. (imagemagick_load): Likewise. (svg_load): Likewise. (gs_load): Likewise.
Diffstat (limited to 'src/nsimage.m')
-rw-r--r--src/nsimage.m12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nsimage.m b/src/nsimage.m
index 13761ba5f71..a42950d1f52 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -83,19 +83,21 @@ int
ns_load_image (struct frame *f, struct image *img,
Lisp_Object spec_file, Lisp_Object spec_data)
{
- EmacsImage *eImg;
+ EmacsImage *eImg = nil;
NSSize size;
NSTRACE (ns_load_image);
- if (NILP (spec_data))
+ if (STRINGP (spec_file))
{
eImg = [EmacsImage allocInitFromFile: spec_file];
}
- else
+ else if (STRINGP (spec_data))
{
- NSData *data = [NSData dataWithBytes: SDATA (spec_data)
- length: SBYTES (spec_data)];
+ NSData *data;
+
+ data = [NSData dataWithBytes: SDATA (spec_data)
+ length: SBYTES (spec_data)];
eImg = [[EmacsImage alloc] initWithData: data];
[eImg setPixmapData];
}