diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-04 18:17:48 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-04 18:24:03 -0300 |
commit | b7c0e34d931af0bf04437e22b2490bee671e123f (patch) | |
tree | 10f27906bbc8fc3ef9f7526153b46c9ca7f10434 /src | |
parent | ed6913fd860f88a9005a08dffec1e7af1df1702c (diff) |
v4l: fix some troubles due to unsigned int on resolutionsdist_improvements
Changeset af1f1940a636 ("Do some code cleanups") caused a
regression when setting the resolution, as x and y could be
a negative value in the past. Fix it.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/v4l.c | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -17,7 +17,7 @@ static int ver = 0, max = 0, min; static int half = 0, use_read = 0, buggery = 0; static gchar *poopoo = NULL; -static int x = -1, y = -1; +static int x = 0, y = 0; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" @@ -59,9 +59,9 @@ static int sort_func(const void *__b, const void *__a) const struct resolutions *b = __b; int r; - r = b->x - a->x; + r = (int)b->x - a->x; if (!r) - r = b->y - a->y; + r = (int)b->y - a->y; return r; } @@ -129,8 +129,8 @@ void camera_cap(cam_t *cam) /* Query supported resolutions */ cam->rdir_ok = FALSE; - cam->min_width = -1; - cam->min_height = -1; + cam->min_width = (unsigned)-1; + cam->min_height = (unsigned)-1; cam->max_width = 0; cam->max_height = 0; for (i = 0;; i++) { |