-
- Downloads
Revised handling of TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value
In order to solve the buffer overflow issues related to TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value, a revised handling of those tags within LibTiff is proposed: Behaviour for writing: `NumberOfInks` MUST fit to the number of inks in the `InkNames` string. `NumberOfInks` is automatically set when `InkNames` is set. If `NumberOfInks` is different to the number of inks within `InkNames` string, that will be corrected and a warning is issued. If `NumberOfInks` is not equal to samplesperpixel only a warning will be issued. Behaviour for reading: When reading `InkNames` from a TIFF file, the `NumberOfInks` will be set automatically to the number of inks in `InkNames` string. If `NumberOfInks` is different to the number of inks within `InkNames` string, that will be corrected and a warning is issued. If `NumberOfInks` is not equal to samplesperpixel only a warning will be issued. This allows the safe use of the NumberOfInks value to read out the InkNames without buffer overflow This MR will close the following issues: #149, #150, #152, #168 (to be checked), #250, #269, #398 and #456. It also fixes the old bug at http://bugzilla.maptools.org/show_bug.cgi?id=2599, for which the limitation of `NumberOfInks = SPP` was introduced, which is in my opinion not necessary and does not solve the general issue.
parent
48d6ece8
No related branches found
No related tags found
Showing
- libtiff/tif_dir.c 70 additions, 49 deletionslibtiff/tif_dir.c
- libtiff/tif_dir.h 2 additions, 0 deletionslibtiff/tif_dir.h
- libtiff/tif_dirinfo.c 1 addition, 1 deletionlibtiff/tif_dirinfo.c
- libtiff/tif_dirwrite.c 5 additions, 0 deletionslibtiff/tif_dirwrite.c
- libtiff/tif_print.c 4 additions, 0 deletionslibtiff/tif_print.c
Loading