Commit bac0a6c1 authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Fix logic in check_camera_roi

parent 54895a4a
......@@ -1929,14 +1929,14 @@ static tao_status check_camera_roi(
long sensorwidth = ncam->base.config.sensorwidth;
long sensorheight = ncam->base.config.sensorheight;
if (is_available(ncam, ROI, 0)
? (roi->xoff != 0 || roi->yoff != 0 ||
roi->xbin != 1 || roi->ybin != 1 ||
roi->width != sensorwidth || roi->height != sensorheight)
: (roi->xoff < 0 || roi->yoff < 0 ||
? (roi->xoff < 0 || roi->yoff < 0 ||
roi->xbin < 1 || roi->ybin < 1 ||
roi->width < 1 || roi->height < 1 ||
roi->xoff + roi->xbin*roi->width > sensorwidth ||
roi->yoff + roi->ybin*roi->height > sensorheight)) {
roi->yoff + roi->ybin*roi->height > sensorheight)
: (roi->xoff != 0 || roi->yoff != 0 ||
roi->xbin != 1 || roi->ybin != 1 ||
roi->width != sensorwidth || roi->height != sensorheight)) {
tao_store_error(__func__, TAO_BAD_ROI);
return TAO_ERROR;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment