Video overlay problem

I’m trying to display a RGB sdl surface on a ovelay, I’ve copied the
functions on sdloverlay2 example but it always shows a green/pink colored
screen. The B/W woks well but on color mode it always shows the wrong
colors, I’ve tried yv12 and others. There’s something that must be set on
the surface or the overlay before convert the colors? I’m using windows and
the overlay example works well.