Commit 71d952f
authored
i.smap: fix possible pole error with log in extract function (OSGeo#4499)
Using logarithm function call with zero argument will lead to
a pole error, which occurs if the mathematical function has
an exact infinite result.
Refactor the conditional to only execute the code when number
of subclasses are more than 1, which would preemptively stop
us from getting into situation where log would have a zero
argument. In cases where number of subclasses are <= 0, set
the default value to 0. This is necessary as `ll` points to
malloc'd memory and can contain random value.
Signed-off-by: Mohan Yelugoti <[email protected]>1 parent 620c822 commit 71d952f
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| |||
0 commit comments