upeksonly: fix scan-build and analyzer issues

This commit is contained in:
Nikolay Metchev 2026-05-01 09:09:17 +00:00
parent 03696b70d1
commit c5896e0f24
3 changed files with 13 additions and 6 deletions

View file

@ -110,7 +110,7 @@ test_valgrind:
extends:
- .standard_job
script:
- meson setup _build -Ddrivers=all
- meson setup _build -Ddrivers=all -Dintrospection=false
- meson compile -C _build
- meson test -C _build --print-errorlogs --no-stdsplit --setup=valgrind
artifacts:

View file

@ -272,15 +272,14 @@ static void
fpc_cmd_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
{
FpiDeviceFpcMoc *self = FPI_DEVICE_FPCMOC (dev);
CommandData *data = fpi_ssm_get_data (ssm);
self->cmd_ssm = NULL;
/* Notify about the SSM failure from here instead. */
if (error)
{
fp_err ("%s error: %s ", G_STRFUNC, error->message);
if (data->callback)
data->callback (self, NULL, error);
if (fpi_ssm_get_data (ssm)->callback)
fpi_ssm_get_data (ssm)->callback (self, NULL, error);
}
}

View file

@ -292,7 +292,7 @@ handoff_img (FpImageDevice *dev)
guint cropped_rows;
guint out_height;
guint row_count = g_slist_length (self->rows);
g_autofree guchar **rows = g_new (guchar *, row_count);
g_autofree guchar **rows = g_new0 (guchar *, row_count);
guint row_idx = 0;
if (row_count != self->num_rows)
@ -331,7 +331,15 @@ handoff_img (FpImageDevice *dev)
guint src_y = crop_start + y * IMG_HEIGHT_SCALE_1002 + i;
guint src_x = IMG_CROP_X_1002 + x;
sum += rows[src_y][src_x];
if (src_y >= row_count)
continue;
guchar *src_row = rows[src_y];
if (!src_row)
continue;
sum += src_row[src_x];
}
img->data[y * IMG_CROP_WIDTH_1002 + x] = sum / IMG_HEIGHT_SCALE_1002;