Commit 6d44dad4 authored by Johann's avatar Johann Committed by Gerrit Code Review
Browse files

Merge "vp8: common: postproc: fix signed overflow of statement of (X +c) >= X...

Merge "vp8: common: postproc: fix signed overflow of statement of (X +c) >= X when '-Werror=strict-overflow' is set."
Showing with 6 additions and 6 deletions
...@@ -214,6 +214,7 @@ static int q2mbl(int x) ...@@ -214,6 +214,7 @@ static int q2mbl(int x)
x = 50 + (x - 50) * 10 / 8; x = 50 + (x - 50) * 10 / 8;
return x * x / 3; return x * x / 3;
} }
void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit) void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit)
{ {
int r, c, i; int r, c, i;
...@@ -226,14 +227,14 @@ void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int co ...@@ -226,14 +227,14 @@ void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int co
int sumsq = 0; int sumsq = 0;
int sum = 0; int sum = 0;
for (i = -8; i<0; i++) for (i = -8; i < 0; i++)
s[i]=s[0]; s[i]=s[0];
/* 17 avoids valgrind warning - we buffer values in c in d /* 17 avoids valgrind warning - we buffer values in c in d
* and only write them when we've read 8 ahead... * and only write them when we've read 8 ahead...
*/ */
for (i = cols; i<cols+17; i++) for (i = 0; i < 17; i++)
s[i]=s[cols-1]; s[i+cols]=s[cols-1];
for (i = -8; i <= 6; i++) for (i = -8; i <= 6; i++)
{ {
...@@ -264,7 +265,6 @@ void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int co ...@@ -264,7 +265,6 @@ void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int co
} }
} }
void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit) void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit)
{ {
int r, c, i; int r, c, i;
...@@ -284,8 +284,8 @@ void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, i ...@@ -284,8 +284,8 @@ void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, i
/* 17 avoids valgrind warning - we buffer values in c in d /* 17 avoids valgrind warning - we buffer values in c in d
* and only write them when we've read 8 ahead... * and only write them when we've read 8 ahead...
*/ */
for (i = rows; i < rows+17; i++) for (i = 0; i < 17; i++)
s[i*pitch]=s[(rows-1)*pitch]; s[(i+rows)*pitch]=s[(rows-1)*pitch];
for (i = -8; i <= 6; i++) for (i = -8; i <= 6; i++)
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment