lavfi/delogo: Fix sign extension issue

Coverity complains about a possible sign extension issue in
apply_delogo(). While it is extremely unlikely to happen, it is easy
to fix so let's just do that. Using unsigned variables even makes the
binary code smaller.

Fixes Coverity CID 1046439.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Jean Delvare 2013-07-13 16:50:42 +02:00 committed by Michael Niedermayer
parent 4cdb42b428
commit b6d0bb6086
1 changed files with 4 additions and 3 deletions

View File

@ -58,9 +58,9 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
uint8_t *src, int src_linesize, uint8_t *src, int src_linesize,
int w, int h, AVRational sar, int w, int h, AVRational sar,
int logo_x, int logo_y, int logo_w, int logo_h, int logo_x, int logo_y, int logo_w, int logo_h,
int band, int show, int direct) unsigned int band, int show, int direct)
{ {
int x, y, dist; int x, y;
uint64_t interp, weightl, weightr, weightt, weightb; uint64_t interp, weightl, weightr, weightt, weightb;
uint8_t *xdst, *xsrc; uint8_t *xdst, *xsrc;
@ -125,7 +125,8 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
x >= logo_x+band && x < logo_x+logo_w-band) { x >= logo_x+band && x < logo_x+logo_w-band) {
*xdst = interp; *xdst = interp;
} else { } else {
dist = 0; unsigned dist = 0;
if (x < logo_x+band) if (x < logo_x+band)
dist = FFMAX(dist, logo_x-x+band); dist = FFMAX(dist, logo_x-x+band);
else if (x >= logo_x+logo_w-band) else if (x >= logo_x+logo_w-band)