Browse Source

avfilter/vf_eq: Fix clipping code

Found-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.6
Michael Niedermayer 10 years ago
parent
commit
530bf8ece6
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      libavfilter/vf_eq.c
  2. +1
    -1
      libavfilter/x86/vf_eq.c

+ 1
- 1
libavfilter/vf_eq.c View File

@@ -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;


+ 1
- 1
libavfilter/x86/vf_eq.c View File

@@ -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;
}


Loading…
Cancel
Save