Mercurial > sdl-ios-xcode
comparison src/video/SDL_yuv_sw.c @ 1920:8a162bfdc838
Convert SDL_malloc to SDL_calloc if appropriate, slightly faster on operating systems which map the zero page for memory allocations.
OpenGL renderer in progress
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 22 Jul 2006 08:33:18 +0000 |
parents | c121d94672cb |
children | a788656ca29a |
comparison
equal
deleted
inserted
replaced
1919:00816063b9c9 | 1920:8a162bfdc838 |
---|---|
1052 int *Cb_g_tab; | 1052 int *Cb_g_tab; |
1053 int *Cb_b_tab; | 1053 int *Cb_b_tab; |
1054 int i; | 1054 int i; |
1055 int CR, CB; | 1055 int CR, CB; |
1056 | 1056 |
1057 swdata = (SDL_SW_YUVTexture *) SDL_malloc(sizeof(*swdata)); | 1057 swdata = (SDL_SW_YUVTexture *) SDL_calloc(1, sizeof(*swdata)); |
1058 if (!swdata) { | 1058 if (!swdata) { |
1059 SDL_OutOfMemory(); | 1059 SDL_OutOfMemory(); |
1060 return NULL; | 1060 return NULL; |
1061 } | 1061 } |
1062 SDL_zerop(swdata); | |
1063 | 1062 |
1064 switch (texture->format) { | 1063 switch (texture->format) { |
1065 case SDL_PixelFormat_YV12: | 1064 case SDL_PixelFormat_YV12: |
1066 case SDL_PixelFormat_IYUV: | 1065 case SDL_PixelFormat_IYUV: |
1067 case SDL_PixelFormat_YUY2: | 1066 case SDL_PixelFormat_YUY2: |