Commit b7c19aee authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wavpack: Add () to protect the arguments of UPDATE_WEIGHT_CLIP()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent dfc2a398
...@@ -104,15 +104,15 @@ typedef struct WvChannel { ...@@ -104,15 +104,15 @@ typedef struct WvChannel {
// macros for applying weight // macros for applying weight
#define UPDATE_WEIGHT_CLIP(weight, delta, samples, in) \ #define UPDATE_WEIGHT_CLIP(weight, delta, samples, in) \
if (samples && in) { \ if ((samples) && (in)) { \
if ((samples ^ in) < 0) { \ if (((samples) ^ (in)) < 0) { \
weight -= delta; \ (weight) -= (delta); \
if (weight < -1024) \ if ((weight) < -1024) \
weight = -1024; \ (weight) = -1024; \
} else { \ } else { \
weight += delta; \ (weight) += (delta); \
if (weight > 1024) \ if ((weight) > 1024) \
weight = 1024; \ (weight) = 1024; \
} \ } \
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment