I figured it out with help from the SDL mailing list. I just had to allocate memory for the r, g, b and a pointers. I thought the SDL_GetRGBA call did this, but guess not.