Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2013-07-13 18:50:42 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-07-13 19:05:03 +0400
commitb6d0bb6086d1e92e120f74dfe6249b7cbf7ced8b (patch)
tree17712f35c20cf9603690a56b35a731892fa15fc9
parent4cdb42b428ef425aceeee548af1ee1a8798a02a2 (diff)
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>
-rw-r--r--libavfilter/vf_delogo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index 8356c615dc..45a29cf00c 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -58,9 +58,9 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
uint8_t *src, int src_linesize,
int w, int h, AVRational sar,
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;
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) {
*xdst = interp;
} else {
- dist = 0;
+ unsigned dist = 0;
+
if (x < logo_x+band)
dist = FFMAX(dist, logo_x-x+band);
else if (x >= logo_x+logo_w-band)