I am Dilip. I am very new to SDL … I am developing a Camera
Application where I am planning to display the Raw Data coming from the
Camera using the SDL.
The Image I am displaying is 640*480 and of 8 Bpp… The procedure I
followed in the program was
- Create the Buffer based on the Image Width and Height
- Use the SDL_CreateRGBSurface() function
- Blit the surface
- Update the Buffer …
But after running the program I am getting the segmentation fault. Is
there any logical or syntax error in this. So somebody please help me
regarding this …
My Program …
SDL_Surface *screen, *image;
// Allocating the Buffer for the Image frame.
char buffer = malloc(HeightWidth*Bpp);
// Infinite Loop to display the Camera data
// Copy the RAW image Data to the Buffer, buffer …
printf(“SDL_Init Video Error !!! \n”);
/* Set the video colormap */
if ( image->format->palette != NULL )
SDL_SetColors(screen, image->format->palette->colors, 0,
/* load the image */
// Update the Buffer
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.