aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-10-27 19:58:41 -0400
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-10-28 21:42:15 -0400
commitfab1562a50684783f5567c5262c942f5cda9656f (patch)
tree291abe939240fa0067780372deaef610f68c591d
parent2193f537ed355e38935bc407ab38bf13b267a34d (diff)
downloadffmpeg-fab1562a50684783f5567c5262c942f5cda9656f.tar.gz
avutil/ripemd: make rol macro more robust by adding parentheses
This ensures that the macro remains correct in the sense of allowing expressions for value and bits, by placing the value and bits expressions within parentheses. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
-rw-r--r--libavutil/ripemd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/ripemd.c b/libavutil/ripemd.c
index d247fb4fc7..6777c994f8 100644
--- a/libavutil/ripemd.c
+++ b/libavutil/ripemd.c
@@ -85,7 +85,7 @@ static const int WB[80] = {
12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
};
-#define rol(value, bits) ((value << bits) | (value >> (32 - bits)))
+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
#define ROUND128_0_TO_15(a,b,c,d,e,f,g,h) \
a = rol(a + (( b ^ c ^ d) + block[WA[n]]), ROTA[n]); \