Browse Source

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.6
Michael Niedermayer 10 years ago
parent
commit
b7c19aee6c
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      libavcodec/wavpack.h

+ 8
- 8
libavcodec/wavpack.h View File

@@ -104,15 +104,15 @@ typedef struct WvChannel {


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




Loading…
Cancel
Save