From 1b16fe9f755d1d35dc42d3aef8de41533aadb0cd Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Wed, 4 Jul 2018 19:11:09 -0600 Subject: [PATCH] Check for invalid dimensions (#749) --- video_v4l2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/video_v4l2.c b/video_v4l2.c index 556a2d47..294a4b02 100644 --- a/video_v4l2.c +++ b/video_v4l2.c @@ -718,11 +718,11 @@ static int v4l2_pixfmt_set(struct context *cnt, struct video_dev *curdev, u32 pi ,vid_source->dst_fmt.fmt.pix.width ,vid_source->dst_fmt.fmt.pix.height); - if ((curdev->width % 8) || (curdev->width % 8)) { - MOTION_LOG(ERR, TYPE_VIDEO, SHOW_ERRNO + if ((curdev->width % 8) || (curdev->height % 8)) { + MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO ,_("Adjusted resolution not modulo 8.")); - MOTION_LOG(ERR, TYPE_VIDEO, SHOW_ERRNO - ,_("Specify different width/height in config file.")); + MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO + ,_("Specify different palette or width/height in config file.")); return -1; } cnt->conf.width = curdev->width; @@ -799,7 +799,7 @@ static int v4l2_pixfmt_select(struct context *cnt, struct video_dev *curdev) { free(palette_array); return 0; } - MOTION_LOG(NTC, TYPE_VIDEO, SHOW_ERRNO + MOTION_LOG(NTC, TYPE_VIDEO, NO_ERRNO ,_("Configuration palette index %d (%s) for %dx%d doesn't work.") , indx_palette, palette_array[indx_palette].fourcc ,cnt->conf.width, cnt->conf.height); @@ -844,7 +844,7 @@ static int v4l2_pixfmt_select(struct context *cnt, struct video_dev *curdev) { free(palette_array); return 0; } - MOTION_LOG(ERR, TYPE_VIDEO, SHOW_ERRNO + MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO ,_("Palette selection failed for format %s") , palette_array[indx_palette].fourcc); }