From f15c734be1650cee240cd65b0dbd31fe6993a5bc Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Tue, 17 Feb 2015 00:47:47 +0100
Subject: [PATCH] avfilter/vf_phase: Add () to protect DIFF()s arguments

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavfilter/vf_phase.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_phase.c b/libavfilter/vf_phase.c
index 82dc603efe5..23b339c8802 100644
--- a/libavfilter/vf_phase.c
+++ b/libavfilter/vf_phase.c
@@ -106,7 +106,7 @@ static int config_input(AVFilterLink *inlink)
  *
  * (The result is actually multiplied by 25)
  */
-#define DIFF(a, as, b, bs) (t = ((*a - b[bs]) << 2) + a[as << 1] - b[-bs], t * t)
+#define DIFF(a, as, b, bs) ((t) = ((*(a) - (b)[bs]) << 2) + (a)[(as) << 1] - (b)[-(bs)], (t) * (t))
 
 /*
  * Find which field combination has the smallest average squared difference
-- 
GitLab