From 4746f16253b784287bc8a5003990c1c3b9a03a62 Mon Sep 17 00:00:00 2001 From: Su_Laus Date: Thu, 25 Aug 2022 16:11:41 +0200 Subject: tiffcrop: disable incompatibility of -Z, -X, -Y, -z options with any PAGE_MODE_x option (fixes #411 and #413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tiffcrop does not support –Z, -z, -X and –Y options together with any other PAGE_MODE_x options like -H, -V, -P, -J, -K or –S. Code analysis: With the options –Z, -z, the crop.selections are set to a value > 0. Within main(), this triggers the call of processCropSelections(), which copies the sections from the read_buff into seg_buffs[]. In the following code in main(), the only supported step, where that seg_buffs are further handled are within an if-clause with if (page.mode == PAGE_MODE_NONE) . Execution of the else-clause often leads to buffer-overflows. Therefore, the above option combination is not supported and will be disabled to prevent those buffer-overflows. The MR solves issues #411 and #413. --- doc/tools/tiffcrop.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/tools/tiffcrop.rst b/doc/tools/tiffcrop.rst index ee0d2d81..b5e8e744 100644 --- a/doc/tools/tiffcrop.rst +++ b/doc/tools/tiffcrop.rst @@ -415,6 +415,14 @@ Options Note: :program:`tiffcrop` may be compiled with :command:`-DDEVELMODE` to enable additional very low level debug reporting. +However, not all option combinations are permitted. + + Note 1: The (-X|-Y), -Z, -z and -S options are mutually exclusive. + In no case should the options be applied to a given selection successively. + + Note 2: Any of the -X, -Y, -Z and -z options together with other PAGE_MODE_x options + such as -H, -V, -P, -J or -K are not supported and may cause buffer overflows. + Examples -------- -- cgit v1.2.1