[SDL] Problens with free surface

Brian brian.ripoff at gmail.com
Thu Jul 12 07:31:18 PDT 2007


Hi.

Looking at the source of SDL_Resize, it Frees the image that was passed to it.
As such it would seem that you are trying to double-free the pointer.

I think if you change code that uses SDL_ResizeXY from code like:
SDL_ResizeXY(sfcResized, 640, 480, 2);
SDL_BlitSurface(sfcResized, NULL, sfcTela, &recResized);
SDL_UpdateRect(sfcTela, 0, 0, TELA_W, TELA_H);
to:
sfcResized = SDL_ResizeXY(sfcResized, 640, 480, 2);
SDL_BlitSurface(sfcResized, NULL, sfcTela, &recResized);
SDL_UpdateRect(sfcTela, 0, 0, TELA_W, TELA_H);

It might work .However, I do not have a compiler here to test this on...

HTH.

On 12/07/07, Rúben Lício <rubenlr at gmail.com> wrote:
> Hi,
>
> I have one game with photo albun with games screenshots. Now i am
> develop one screen to display shots captured by game.
> It will display one screenshot by time, I think the best way is using
> one surface for all of them, and free it after use. But its not
> working on.
> ...
> --
> Rúben Lício Reis


More information about the SDL mailing list