[Libreoffice] [PATCH] Fix for #i93300#: Crash when inserting 32 bit TIFF image
hatapitk at iki.fi
Tue Oct 19 10:25:39 PDT 2010
The sample documents in the bug had two problems: 32 bit sample size
and use of floating point sample format. Neither is supported so this
patch adds checks to reject images that have either of these properties.
Additionally a sanity check is added to make sure that similar crash
(division by zero) cannot be induced by creating a malformed image that
specifies the same values for MaxSampleValue and MinSampleValue.
Some literals have been changed from 1 to 1UL since the result will
be assigned to a variable with ULONG data type. With this change it
was actually possible to load the 32 bit image on a 64 bit system but
the colors were distorted (probably due to unsupported sample format).
So rejecting all 32 bit images still seems to be necessary.
This patch has been tested on a 64 bit Linux system using the samples
in the bug and some images from libtiff sample collection at
Signed-off-by: Harri Pitkänen <hatapitk at iki.fi>
filter/source/graphicfilter/itiff/itiff.cxx | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2487 bytes
Desc: not available
More information about the LibreOffice