[FFmpeg-cvslog] vf_idet: Fix macro arguments sideeffect

Michael Niedermayer git at videolan.org
Thu Feb 21 01:59:08 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Feb 21 01:49:56 2013 +0100| [dc9edb06b011c2999b59065542332ad6ece80647] | committer: Michael Niedermayer

vf_idet: Fix macro arguments sideeffect

Fixes valgrind errors
should improve detection scores

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc9edb06b011c2999b59065542332ad6ece80647
---

 libavfilter/vf_idet.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index 513a8e3..6fa9699 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -83,7 +83,8 @@ static int filter_line_c(const uint8_t *a, const uint8_t *b, const uint8_t *c, i
     int ret=0;
 
     for(x=0; x<w; x++){
-        ret += FFABS((*a++ + *c++) - 2 * *b++);
+        int v = (*a++ + *c++) - 2 * *b++;
+        ret += FFABS(v);
     }
 
     return ret;
@@ -95,7 +96,8 @@ static int filter_line_c_16bit(const uint16_t *a, const uint16_t *b, const uint1
     int ret=0;
 
     for(x=0; x<w; x++){
-        ret += FFABS((*a++ + *c++) - 2 * *b++);
+        int v = (*a++ + *c++) - 2 * *b++;
+        ret += FFABS(v);
     }
 
     return ret;



More information about the ffmpeg-cvslog mailing list