--- a/src/extract.c +++ b/src/extract.c @@ -1056,10 +1056,8 @@ PURPOSE initialize a pixel-list and its components. ***/ void plistinit(int hasconv, int hasvar) { - pbliststruct * pbdum = NULL; - plistsize = sizeof(pbliststruct); - plistoff_value = (char *)&pbdum->value - (char *)pbdum; + plistoff_value = offsetof(pbliststruct, value); if (hasconv) { plistexist_cdvalue = 1; @@ -1082,6 +1080,9 @@ plistexist_var = 0; plistexist_thresh = 0; } + /* Stellastack: appended float fields must not misalign the next record. */ + const size_t alignment = _Alignof(pbliststruct); + plistsize = ((plistsize + alignment - 1) / alignment) * alignment; } @@ -1293,8 +1294,6 @@ QMALLOC(cat->ycpeak, int64_t, nobj, status); QMALLOC(cat->xpeak, int64_t, nobj, status); QMALLOC(cat->ypeak, int64_t, nobj, status); - QMALLOC(cat->cflux, float, nobj, status); - QMALLOC(cat->flux, float, nobj, status); QMALLOC(cat->flag, short, nobj, status); /* fill output arrays */