diff options
| author | Paul Eggert | 2011-07-09 00:01:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-09 00:01:24 -0700 |
| commit | 3f791afed9cd1002b909cefd3482763b2a310608 (patch) | |
| tree | cda22ac880a1ea3aaf79c03c1f3352212ee4d10c /src/ChangeLog | |
| parent | 3cc5a5328c43317b12a7163c4e1c0a56d85b93ce (diff) | |
| download | emacs-3f791afed9cd1002b909cefd3482763b2a310608.tar.gz 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 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index aaf87deb9a5..d7ee434378c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2011-07-09 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * image.c: Integer signedness and overflow and related fixes. | ||
| 4 | This is not an exhaustive set of fixes, but it's time to | ||
| 5 | record what I've got. | ||
| 6 | (lookup_pixel_color, check_image_size): Remove redundant decls. | ||
| 7 | (check_image_size): Don't assume that arbitrary EMACS_INT values | ||
| 8 | fit in 'int', or that arbitrary 'double' values fit in 'int'. | ||
| 9 | (x_alloc_image_color, x_create_x_image_and_pixmap, png_load) | ||
| 10 | (tiff_load, imagemagick_load_image): | ||
| 11 | Check for overflow in size calculations. | ||
| 12 | (x_create_x_image_and_pixmap): Remove unnecessary test for | ||
| 13 | xmalloc returning NULL; that can't happen. | ||
| 14 | (xbm_read_bitmap_data): Don't assume sizes fit into 'int'. | ||
| 15 | (xpm_color_bucket): Use better integer hashing function. | ||
| 16 | (xpm_cache_color): Don't possibly over-allocate memory. | ||
| 17 | (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory) | ||
| 18 | (gif_memory_source): | ||
| 19 | Use ptrdiff_t, not int or size_t, to record sizes. | ||
| 20 | (png_load): Don't assume values greater than 2**31 fit in 'int'. | ||
| 21 | (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when | ||
| 22 | either works, as we prefer signed integers. | ||
| 23 | (tiff_read_from_memory, tiff_write_from_memory): | ||
| 24 | Return tsize_t, not size_t, since that's what the TIFF API wants. | ||
| 25 | (tiff_read_from_memory): Don't fail simply because the read would | ||
| 26 | go past EOF; instead, return a short read. | ||
| 27 | (tiff_load): Omit no-longer-needed casts. | ||
| 28 | (Fimagemagick_types): Don't assume size fits into 'int'. | ||
| 29 | |||
| 1 | 2011-07-08 Paul Eggert <eggert@cs.ucla.edu> | 30 | 2011-07-08 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 31 | ||
| 3 | Improve hashing quality when configured --with-wide-int. | 32 | Improve hashing quality when configured --with-wide-int. |