Skip to content
  • Su Laus's avatar
    tiffcrop: disable incompatibility of -Z, -X, -Y, -z options with any... · 4746f162
    Su Laus authored
    tiffcrop: disable incompatibility of -Z, -X, -Y, -z options with any PAGE_MODE_x option (fixes #411 and #413)
    
    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.
    4746f162