1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/vf_maskedclamp: make C version consistent with ASM one

In case of undefined behaviour.
This commit is contained in:
Paul B Mahol 2020-02-08 10:44:38 +01:00
parent 3b860bfd6f
commit 68416e4ba7

View File

@ -178,12 +178,8 @@ static void maskedclamp##name(const uint8_t *bbsrc, uint8_t *ddst,
type *dst = (type *)ddst; \
\
for (int x = 0; x < w; x++) { \
if (bsrc[x] < darksrc[x] - undershoot) \
dst[x] = darksrc[x] - undershoot; \
else if (bsrc[x] > brightsrc[x] + overshoot) \
dst[x] = brightsrc[x] + overshoot; \
else \
dst[x] = bsrc[x]; \
dst[x] = FFMAX(bsrc[x], darksrc[x] - undershoot); \
dst[x] = FFMIN(dst[x], brightsrc[x] + overshoot); \
} \
}