Pb with Fill_Rect

Hi!
I got a pb with a fill_rect focntion… here is a part of my code
I want to draw some pixels on a played video movie and i use a "putpixel"
focntion

header :
extern void putpixel(SDL_Surface *screen, SDL_Surface *surface, int x, int
y, Uint32 pixel);

Here is the focntion :

void putpixel(SDL_Surface *screen, SDL_Surface *surface, int x, int y,
Uint32 pixel)
{
Uint32 blanc ;
SDL_Rect dest;

blanc   = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);

dest.x = x-2;
dest.y = y-2;
dest.w = 3;
dest.h = 3;


SDL_FillRect(screen, &dest, blanc);

SDL_UpdateRects(screen, 1, &dest);

The screen in the header is the typical screen surface and the surface in
the header is a surface called surface_p which has been converted to the
same format as screen and in which i will to keep the position of the pixels
i have put on the video.

The code i gave you is working but i can’t keep the pixels… It appears and
disappears each time a new picture is displayed for the video…
If i change all the “screen” in the putpixel fonction in “surface” I got an
error (“segementation fault”) when i tried to use the Fill_rect
(SDL_FillRect (surface, &dest, blanc) )
And i dunno why… Does anyone can help me ?

I also got another pb… I got a crash when i ran the prog for the last
time… And now when i try to compile Cygwin tells me that "Nothing is to be
done for “all” … Here is my Makefile (it has worked for 3 months without a
crash:

INC_DIR = /usr/local/include/SDL
LIB_DIR = /usr/local/lib
SDL_LIB = -lSDL -lSDL_net -ljpeg

CFLAGS = -I$(INC_DIR) -O2 -DPOINTING=1 #-ggdb

include interface.mk
include codagevid.mk

SRCS = main.c
debug.c
queue.c
$(INTERFACE_SRC)
$(CODAGEVID_SRC)

OBJS = $(SRCS:%.c=%.o)

all: main

include .depends

main: $(OBJS)
$(CC) $(OBJS) $(SDL_LIB) -o $@

$(OBJS): %.o: %.c
$(CC) -c $< $(CFLAGS) -o $@

.depends depends:
@$(RM) .depends
@touch .depends
@$(CC) -MM $(CFLAGS) $(SRCS) >> .depends

clean:
$(RM) *~ $(OBJS) .depends main.exe

HEEELLLPPP!!!
Thx…

@Olivier_Caignart

PS: If my english is not clear i can send you the same questions in french
:)_________________________________________________________________
Discutez en ligne avec vos amis, essayez MSN Messenger?:
http://messenger.msn.fr

SDL_FillRect(screen, &dest, blanc);
SDL_UpdateRects(screen, 1, &dest);

The code i gave you is working but i can’t keep the pixels… It appears and
disappears each time a new picture is displayed for the video…

It sounds like the picture is overwriting the pixels.
Try drawing the picture, and then draw all the pixels and then update the
screen all at once.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment