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.
This commit is contained in:
Andreas Schwab 2010-09-04 21:39:34 +02:00
parent 5abf15563a
commit 7574650a39
3 changed files with 217 additions and 196 deletions

View file

@ -1,3 +1,19 @@
2010-09-04 Andreas Schwab <schwab@linux-m68k.org>
* 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.
2010-09-04 Eli Zaretskii <eliz@gnu.org>
* w32uniscribe.c (uniscribe_shape): Update commentary. Don't

File diff suppressed because it is too large Load diff

View file

@ -83,19 +83,21 @@ Updated by Christian Limpach (chris@nice.ch)
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];
}