Issue #213: fix crash in ResizePngImage(), due to small scaling factor

This commit is contained in:
Ansgar Becker
2018-11-05 07:47:24 +01:00
parent 1e92d36cea
commit 953cce3b58

View File

@ -3064,8 +3064,8 @@ begin
else
new_colortype := COLOR_RGB;
bTmp := TPNGImage.CreateBlank(new_colortype, 8, NewWidth, NewHeight);
xscale := bTmp.Width / (aPng.Width-0.35); // Modified: (was -1) substract minimal value before AlphaScanline crashes
yscale := bTmp.Height / (aPng.Height-0.35);
xscale := bTmp.Width / (aPng.Width-1);
yscale := bTmp.Height / (aPng.Height-1);
for to_y:=0 to bTmp.Height-1 do begin
sfrom_y := to_y / yscale;
ifrom_y := Trunc(sfrom_y);