[FFmpeg-cvslog] avcodec/wavpack: Add () to protect the arguments of UPDATE_WEIGHT_CLIP()
Michael Niedermayer
git at videolan.org
Wed Feb 18 01:50:25 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 18 01:37:06 2015 +0100| [b7c19aee6c86f6924f83a8e2a7b087b8ea6c00fa] | committer: Michael Niedermayer
avcodec/wavpack: Add () to protect the arguments of UPDATE_WEIGHT_CLIP()
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b7c19aee6c86f6924f83a8e2a7b087b8ea6c00fa
---
libavcodec/wavpack.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libavcodec/wavpack.h b/libavcodec/wavpack.h
index 6cb49a1..a1b46d5 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; \
} \
}
More information about the ffmpeg-cvslog
mailing list