diff --git a/libavcodec/vp8dsp.c b/libavcodec/vp8dsp.c
index ab310992b93408715857a1f2418dd540ad01e421..8f9124e0d429f200438a895a4b3c2e59fee34c0a 100644
--- a/libavcodec/vp8dsp.c
+++ b/libavcodec/vp8dsp.c
@@ -214,12 +214,15 @@ static void vp8_ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, int stride,\
 static void vp8_ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, int stride,\
                                       int flim_E, int flim_I, int hev_thresh)\
 {\
-    int i, hv;\
+    int i;\
 \
     for (i = 0; i < size; i++)\
         if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
-            hv = hev(dst+i*stridea, strideb, hev_thresh);\
-            filter_common(dst+i*stridea, strideb, hv);\
+            int hv = hev(dst+i*stridea, strideb, hev_thresh);\
+            if (hv) \
+                filter_common(dst+i*stridea, strideb, 1);\
+            else \
+                filter_common(dst+i*stridea, strideb, 0);\
         }\
 }