Merge pull request #599 from tkoeppe/divzero

[q3map2] Avoid division by zero (remove removable singularity)
This commit is contained in:
Timothee "TTimo" Besset 2018-02-24 16:22:31 -06:00 committed by GitHub
commit b48cf2679d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1052,8 +1052,12 @@ static void ParseRawBrush( qboolean onlyLights ){
/* ydnar: gs mods: bias texture shift */
if ( si->globalTexture == qfalse ) {
shift[ 0 ] -= ( floor( shift[ 0 ] / si->shaderWidth ) * si->shaderWidth );
shift[ 1 ] -= ( floor( shift[ 1 ] / si->shaderHeight ) * si->shaderHeight );
if ( si->shaderWidth > 0 ) {
shift[ 0 ] -= ( floor( shift[ 0 ] / si->shaderWidth ) * si->shaderWidth );
}
if ( si->shaderHeight ) {
shift[ 1 ] -= ( floor( shift[ 1 ] / si->shaderHeight ) * si->shaderHeight );
}
}
/*