aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-18 01:37:06 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-18 01:49:35 +0100
commitb7c19aee6c86f6924f83a8e2a7b087b8ea6c00fa (patch)
treedf01959a510e30fbd4c1812e59af68be6b973ed8
parentdfc2a3982fa8de0fdd98d347beef661fe0ab136d (diff)
downloadffmpeg-b7c19aee6c86f6924f83a8e2a7b087b8ea6c00fa.tar.gz
avcodec/wavpack: Add () to protect the arguments of UPDATE_WEIGHT_CLIP()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wavpack.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/wavpack.h b/libavcodec/wavpack.h
index 6cb49a1b3e..a1b46d5bd7 100644
--- a/libavcodec/wavpack.h
+++ b/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; \
} \
}