# HG changeset patch # User Edgar Simo # Date 1249403955 0 # Node ID f7a3a47e6b508f4c68bd97b4d036580b969ea3ad # Parent be037e51f0800932dfd54ec17ad2473905dbb804 Fixed errors detected by valgrind. diff -r be037e51f080 -r f7a3a47e6b50 test/automated/render/render.c --- a/test/automated/render/render.c Tue Aug 04 16:34:04 2009 +0000 +++ b/test/automated/render/render.c Tue Aug 04 16:39:15 2009 +0000 @@ -570,15 +570,15 @@ if (SDL_ATassert( "SDL_CreateTextureFromSurface", tface != 0)) return -1; - /* Clean up. */ - SDL_FreeSurface( face ); - /* Constant values. */ rect.w = face->w; rect.h = face->h; ni = SCREEN_W - face->w; nj = SCREEN_H - face->h; + /* Clean up. */ + SDL_FreeSurface( face ); + /* Loop blit. */ for (j=0; j <= nj; j+=4) { for (i=0; i <= ni; i+=4) { @@ -631,15 +631,15 @@ if (SDL_ATassert( "SDL_CreateTextureFromSurface", tface != 0)) return -1; - /* Clean up. */ - SDL_FreeSurface( face ); - /* Constant values. */ rect.w = face->w; rect.h = face->h; ni = SCREEN_W - face->w; nj = SCREEN_H - face->h; + /* Clean up. */ + SDL_FreeSurface( face ); + /* Test blitting with colour mod. */ for (j=0; j <= nj; j+=4) { for (i=0; i <= ni; i+=4) { @@ -698,15 +698,15 @@ if (SDL_ATassert( "SDL_CreateTextureFromSurface", tface != 0)) return -1; - /* Clean up. */ - SDL_FreeSurface( face ); - /* Constant values. */ rect.w = face->w; rect.h = face->h; ni = SCREEN_W - face->w; nj = SCREEN_H - face->h; + /* Clean up. */ + SDL_FreeSurface( face ); + /* Clear surface. */ if (render_clearScreen()) return -1; @@ -812,6 +812,14 @@ if (SDL_ATassert( "SDL_CreateTextureFromSurface", tface != 0)) return -1; + /* Steps to take. */ + ni = SCREEN_W - FACE_W; + nj = SCREEN_H - FACE_H; + + /* Constant values. */ + rect.w = face->w; + rect.h = face->h; + /* Clean up. */ SDL_FreeSurface( face ); @@ -820,14 +828,6 @@ if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) return -1; - /* Steps to take. */ - ni = SCREEN_W - FACE_W; - nj = SCREEN_H - FACE_H; - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - /* Test None. */ if (render_testBlitBlendMode( tface, SDL_BLENDMODE_NONE )) return -1;