Hello,
please let me know which target you are using and which compiler you are using. Are there any compiler warnings reported?
A couple of months ago we had a similar issue on RX65 taget due to an IAR compiler issue with incorrect copied color structs. It looks to me, that this might be also here the case.
Best regards,
Manfred.