summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-07-09 00:01:24 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-07-09 00:01:24 -0700
commit3f791afed9cd1002b909cefd3482763b2a310608 (patch)
treecda22ac880a1ea3aaf79c03c1f3352212ee4d10c /lib-src
parent3cc5a5328c43317b12a7163c4e1c0a56d85b93ce (diff)
downloademacs-3f791afed9cd1002b909cefd3482763b2a310608.tar.gz
emacs-3f791afed9cd1002b909cefd3482763b2a310608.tar.bz2
emacs-3f791afed9cd1002b909cefd3482763b2a310608.zip
* image.c: Integer signedness and overflow and related fixes.
This is not an exhaustive set of fixes, but it's time to record what I've got. (lookup_pixel_color, check_image_size): Remove redundant decls. (check_image_size): Don't assume that arbitrary EMACS_INT values fit in 'int', or that arbitrary 'double' values fit in 'int'. (x_alloc_image_color, x_create_x_image_and_pixmap, png_load) (tiff_load, imagemagick_load_image): Check for overflow in size calculations. (x_create_x_image_and_pixmap): Remove unnecessary test for xmalloc returning NULL; that can't happen. (xbm_read_bitmap_data): Don't assume sizes fit into 'int'. (xpm_color_bucket): Use better integer hashing function. (xpm_cache_color): Don't possibly over-allocate memory. (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory) (gif_memory_source): Use ptrdiff_t, not int or size_t, to record sizes. (png_load): Don't assume values greater than 2**31 fit in 'int'. (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when either works, as we prefer signed integers. (tiff_read_from_memory, tiff_write_from_memory): Return tsize_t, not size_t, since that's what the TIFF API wants. (tiff_read_from_memory): Don't fail simply because the read would go past EOF; instead, return a short read. (tiff_load): Omit no-longer-needed casts. (Fimagemagick_types): Don't assume size fits into 'int'.
Diffstat (limited to 'lib-src')
0 files changed, 0 insertions, 0 deletions