In case of undefined behaviour.
Unified · Split
| @@ -178,12 +178,8 @@ static void maskedclamp##name(const uint8_t *bbsrc, uint8_t *ddst, · 177 unmodified lines | |||
| 178 | type *dst = (type *)ddst; \ | 178 | type *dst = (type *)ddst; \ |
| 179 | \ | 179 | \ |
| 180 | for (int x = 0; x < w; x++) { \ | 180 | for (int x = 0; x < w; x++) { \ |
| 181 | if (bsrc[x] < darksrc[x] - undershoot) \ | 181 | dst[x] = FFMAX(bsrc[x], darksrc[x] - undershoot); \ |
| 182 | dst[x] = darksrc[x] - undershoot; \ | 182 | dst[x] = FFMIN(dst[x], brightsrc[x] + overshoot); \ |
| 183 | else if (bsrc[x] > brightsrc[x] + overshoot) \ | ||
| 184 | dst[x] = brightsrc[x] + overshoot; \ | ||
| 185 | else \ | ||
| 186 | dst[x] = bsrc[x]; \ | ||
| 187 | } \ | 183 | } \ |
| 188 | } | 184 | } |
| 189 | 185 | ||