Commit b285f501 authored by Sam Lantinga's avatar Sam Lantinga

valgrind FTW!

parent 864b4535
...@@ -193,7 +193,7 @@ Cocoa_CreateImage(SDL_Surface * surface) ...@@ -193,7 +193,7 @@ Cocoa_CreateImage(SDL_Surface * surface)
SDL_FreeSurface(converted); SDL_FreeSurface(converted);
/* Premultiply the alpha channel */ /* Premultiply the alpha channel */
for (i = (converted->h * converted->w); i--; ) { for (i = (surface->h * surface->w); i--; ) {
Uint8 alpha = pixels[3]; Uint8 alpha = pixels[3];
pixels[0] = (Uint8)(((Uint16)pixels[0] * alpha) / 255); pixels[0] = (Uint8)(((Uint16)pixels[0] * alpha) / 255);
pixels[1] = (Uint8)(((Uint16)pixels[1] * alpha) / 255); pixels[1] = (Uint8)(((Uint16)pixels[1] * alpha) / 255);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment