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 {
// macros for applying weight
#define UPDATE_WEIGHT_CLIP(weight, delta, samples, in) \
if (samples && in) { \
if ((samples ^ in) < 0) { \
weight -= delta; \
if (weight < -1024) \
weight = -1024; \
if ((samples) && (in)) { \
if (((samples) ^ (in)) < 0) { \
(weight) -= (delta); \
if ((weight) < -1024) \
(weight) = -1024; \
} else { \
weight += delta; \
if (weight > 1024) \
weight = 1024; \
(weight) += (delta); \
if ((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