XCode sample shows distorted video

Hi,
I am trying to raw video using SDL, the code compiles and runs properly but
shows distorted video. Can anyone help me on this.

I am attaching the sample code.
http://www.4shared.com/zip/wosqoKkT/HelloSDL.html

Thanks in advance.

Regards
symadept