don't attempt to prettify alpha of single-pixel textures (segfault with "digital" theme from forums)
authorsheepluva
Sun, 10 Jan 2016 18:01:17 +0100
changeset 11487 8e221d2a368e
parent 11486 2b30283a402c
child 11489 84eb32d9e279
don't attempt to prettify alpha of single-pixel textures (segfault with "digital" theme from forums)
hedgewars/uTextures.pas
--- a/hedgewars/uTextures.pas	Sun Jan 10 17:39:27 2016 +0100
+++ b/hedgewars/uTextures.pas	Sun Jan 10 18:01:17 2016 +0100
@@ -176,6 +176,9 @@
     r, slr, w, si, li: LongWord;
 begin
     w:= surf^.w;
+    // just a single pixel, nothing to do here
+    if (w < 2) and (surf^.h < 2) then
+        exit;
     slr:= surf^.h - 2;
     si:= 0;
     li:= w - 1;