Skip to content

Splash bilinear scaling: Don't try to read behind end of source image

Source line iteration in Splash::scaleImageYuXuBilinear already tries to prevent a read behind source image end, as the comment indicates it and as it's conceptually reasonable. But the check for (currentSrcRow < srcHeight) is wrong and doesn't do what it claims.

currentSrcRow will only ever increase to srcHeight - 1 after scaledHeight iterations. Therefore the check always evaluates to true, and src() is aways called. Intention was to prevented the line fetch for the last run and leave line2 identical to line1 (the "extra padding").

Nothing bad happened, because SplashOutputDev::imageSrc and SplashOutputDev::alphaImageSrc gracefully handle the behind-end read. Should be corrected either.

Edited by Tobias Deiminger

Merge request reports