Skip to content

Thunder RLE can fail to decode last run.

robinwatts requested to merge robinwatts/libtiff:thunder into master

Bug seen with GhostPDL. Decode of test tif file gives valgrind errors due to the "thunder decode" failing to extract the final run of compressed pixels.

The logic in the decoder, presumably intended to spot overruns of data, is incorrect in that runs that end at the end of a row (npixels == maxpixels) will not be decoded.

Fix this by limiting 'n', the number of pixels to copy. Note that npixels is updated by the 'unlimited' value to ensure the error reporting at the end of the loop still works.

The problem can be seen by looking at text.tif linked from this page:

Merge request reports