On Wed, 29 Sept 2021 at 12:21, RĂ©mi Bernon rbernon@codeweavers.com wrote:
The problem actually comes from D3DXVec2Subtract which can return NULL if any of the input pointer is.
It's a little bit convoluted, but although the code takes the address of the vector, it's still possible to end up with NULL pointers.
For instance if outline->items == NULL and pt_index == 0, pt or prevpt (if pt_index == 1, or wraps around) may be NULL. Then, as pos is the first member, &pt->pos (or &prevpt->pos) may be NULL as well.
Of course, outline->items is probably not NULL, but that may be too complicated to infer.
Changing pos to be second point2d member solves the warning too.
Ah right, if D3DXVec2Subtract() would return NULL it would leave "dir" uninitialised.
Of course if "outline->items" is in fact NULL, "lastdir" being uninitialised probably isn't the worst thing that's going to happen, but that seems fair enough.