Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-18 03:37:06 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-02-18 03:49:35 +0300
commitb7c19aee6c86f6924f83a8e2a7b087b8ea6c00fa (patch)
treedf01959a510e30fbd4c1812e59af68be6b973ed8 /libavcodec/wavpack.h
parentdfc2a3982fa8de0fdd98d347beef661fe0ab136d (diff)
avcodec/wavpack: Add () to protect the arguments of UPDATE_WEIGHT_CLIP()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wavpack.h')
-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; \
} \
}