From bfa4bd07e4239b4789e2185d611c0ed40b065245 Mon Sep 17 00:00:00 2001 From: Tomas Farago Date: Fri, 17 Dec 2021 17:46:16 +0100 Subject: reader: turn warnings to errors --- src/ufo-read-task.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ufo-read-task.c b/src/ufo-read-task.c index 5aeb731..8c8b3b5 100644 --- a/src/ufo-read-task.c +++ b/src/ufo-read-task.c @@ -279,9 +279,10 @@ ufo_read_task_get_requisition (UfoTask *task, return; if (priv->roi_y >= requisition->dims[1]) { - g_warning ("read: vertical ROI start %i >= height %zu", - priv->roi_y, requisition->dims[1]); - priv->roi_y = 0; + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "read: vertical ROI start %i >= height %zu", + priv->roi_y, requisition->dims[1]); + return; } if (!priv->roi_height) { @@ -289,9 +290,10 @@ ufo_read_task_get_requisition (UfoTask *task, } else { if (priv->roi_y + priv->roi_height > requisition->dims[1]) { - g_warning ("read: vertical ROI height %i >= height %zu", - priv->roi_height, requisition->dims[1]); - priv->roi_height = requisition->dims[1] - priv->roi_y; + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "read: vertical ROI start + height %i >= height %zu", + priv->roi_y + priv->roi_height, requisition->dims[1]); + return; } } if (priv->image_start >= num_images) { -- cgit v1.2.3