TextureTools: fix driver crash on AMD.
TextureTools: fix driver crash on AMD.

For some reason this was causing the inner for cycle to loop
indefinitely on AMD cards. Not a problem or NVidia drivers, Intel
Windows drivers or Mesa. Thanks a lot to @LB-- for the investigation.

MiUishadow/magnum,MiUishadow/magnum,MiUishadow/magnum,MiUishadow/magnum,MiUishadow/magnum,MiUishadow/magnum