mirror of
https://github.com/Motion-Project/motion.git
synced 2026-02-04 20:11:58 -05:00
Check for invalid dimensions (#749)
This commit is contained in:
12
video_v4l2.c
12
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user