# HG changeset patch # User unc0rr # Date 1204745692 0 # Node ID e7fa1a1b97919dbddd8bcd2c49333982c5bb92d6 # Parent 81057bc8a02eb449635eefdc72b187c9acdfcc10 Fix bug with handling explosions (wrong parameters passed to glTexSubImage2D) spotted by Tiyuri diff -r 81057bc8a02e -r e7fa1a1b9791 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Tue Mar 04 21:33:10 2008 +0000 +++ b/hedgewars/uLand.pas Wed Mar 05 19:34:52 2008 +0000 @@ -635,6 +635,9 @@ begin if LandTexture <> nil then begin + if (Height <= 0) then exit; + TryDo((Y >= 0) and (Y < 1024), 'UpdateLandTexture: wrong Y parameter', true); + TryDo(Y + Height < 1024, 'UpdateLandTexture: wrong Height parameter', true); glBindTexture(GL_TEXTURE_2D, LandTexture^.id); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, Y, 2048, Height, GL_RGBA, GL_UNSIGNED_BYTE, @LandPixels[Y, 0]);