Permalink
Browse files

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

  • Loading branch information...
ansgarbecker committed Nov 5, 2018
1 parent 1e92d36 commit 953cce3b58864833c82514a1675cf45405da221a
Showing with 2 additions and 2 deletions.
  1. +2 −2 source/apphelpers.pas
@@ -3064,8 +3064,8 @@ procedure ResizePngImage(aPng: TPNGImage; NewWidth, NewHeight: Integer);
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);

0 comments on commit 953cce3

Please sign in to comment.