Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix potential crash in color ramp shader
Fixes #19445

(cherry-picked from f3650e6)
  • Loading branch information
nyalldawson committed Jul 20, 2018
1 parent 1601e57 commit 237af60
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/raster/qgscolorrampshader.cpp
Expand Up @@ -346,6 +346,9 @@ bool QgsColorRampShader::shade( double value, int *returnRedValue, int *returnGr
mLUTInitialized = true;
}

if ( mLUT.empty() )
return false;

// overflow indicates that value > maximum value + DOUBLE_DIFF_THRESHOLD
// that way idx can point to the last valid item
bool overflow = false;
Expand Down

0 comments on commit 237af60

Please sign in to comment.