I get this error when compiling and have checked out other questions here with no further progress:
funciones.c: In function ‘Lyapunov’: ../funciones.
unsigned char rgb[3];
is local to function and the scope of this array is within the function Lyapunov so once you exit the function this memory is no more valid. So the warning you are getting is the right one which says never return the local variables address which will lead to undefined behavior when used outside its scope.
Have your memory allocated of heap and then return the pointer as shown below.
unsigned char *rgb = malloc(3);