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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/113/head^2
Michael Niedermayer 10 years ago
parent dfc2a3982f
commit b7c19aee6c
  1. 16
      libavcodec/wavpack.h

@ -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; \
} \
}

Loading…
Cancel
Save