[FFmpeg-cvslog] avfilter/vf_eq: Fix clipping code

Michael Niedermayer git at videolan.org
Tue Jan 27 01:01:22 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jan 26 23:46:44 2015 +0100| [530bf8ece6f828262b211edab1b97b873569b255] | committer: Michael Niedermayer

avfilter/vf_eq: Fix clipping code

Found-by: Christophe Gisquet <christophe.gisquet at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/vf_eq.c     |    2 +-
 libavfilter/x86/vf_eq.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c
index 0c2f0ce..7bbbaee 100644
--- a/libavfilter/vf_eq.c
+++ b/libavfilter/vf_eq.c
@@ -91,7 +91,7 @@ static void process_c(EQParameters *param, uint8_t *dst, int dst_stride,
         for (x = 0; x < w; x++) {
             pel = ((src[y * src_stride + x] * contrast) >> 12) + brightness;
 
-            if (pel & 768)
+            if (pel & ~255)
                 pel = (-pel) >> 31;
 
             dst[y * dst_stride + x] = pel;
diff --git a/libavfilter/x86/vf_eq.c b/libavfilter/x86/vf_eq.c
index cfcc18f..2e42cdf 100644
--- a/libavfilter/x86/vf_eq.c
+++ b/libavfilter/x86/vf_eq.c
@@ -72,7 +72,7 @@ static void process_MMX(EQParameters *param, uint8_t *dst, int dst_stride,
 
                 for (i = w&7; i; i--) {
                         pel = ((*src++ * contrast) >> 12) + brightness;
-                        if (pel & 768)
+                        if (pel & ~255)
                             pel = (-pel) >> 31;
                         *dst++ = pel;
                 }



More information about the ffmpeg-cvslog mailing list