tiffcrop: disable incompatibility of -Z, -X, -Y, -z options with any PAGE_MODE_x option (fixes #411, #413 and #426)
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, -X and -Y 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.
This MR solves issues #411 (closed) and #413 (closed), and also #426 (closed).