Obtaining RGB and RGBA values from a pixel

IN ENGLISH:

Hi again and, first of all, sorry about my low english :wink:

I am trying to use SDL_MapRGB in a while, but some time later the while is
running, ever I have "Fatal Signal: Segmentation Fault (SDL Parachute
Deployed).

I trying to use SDL_lockSurface and SDL_UnlockSurface, but the result is
repeated.

The example I use:

http://www.gamedev.net/reference/programming/features/sdl2/page5.asp

EN CASTELLANO:

Buenas a todos y espero que haya mas gente que hable castellano y no solo
cuatro gatos. Bueno, de hecho ha contestado otra persona ya, asi que de
momento la cuenta esta en dos gatos :wink:

Problema: estoy usando SDL_MapRGB, combinado con SDL_LockSurfsace y
SDL_UnlockSurface para modificar directamente los valores RGB de un pixel.

Navegando, encontre esta forma:

http://www.gamedev.net/reference/programming/features/sdl2/page5.asp

Pinta los pixeles, pero el problema es que luego SDL peta.