diff -r 2167a41feefe src/video/SDL_blit.h --- a/src/video/SDL_blit.h Mon Jun 06 12:20:04 2011 -0400 +++ b/src/video/SDL_blit.h Sun Jun 12 20:05:00 2011 +0200 @@ -92,7 +92,8 @@ /* the version count matches the destination; mismatch indicates an invalid mapping */ - Uint32 palette_version; + Uint32 dst_palette_version; + Uint32 src_palette_version; } SDL_BlitMap; /* Functions found in SDL_blit.c */ diff -r 2167a41feefe src/video/SDL_pixels.c --- a/src/video/SDL_pixels.c Mon Jun 06 12:20:04 2011 -0400 +++ b/src/video/SDL_pixels.c Sun Jun 12 20:05:00 2011 +0200 @@ -955,7 +955,8 @@ return; } map->dst = NULL; - map->palette_version = 0; + map->src_palette_version = 0; + map->dst_palette_version = 0; if (map->info.table) { SDL_free(map->info.table); map->info.table = NULL; @@ -1022,9 +1023,15 @@ map->dst = dst; if (dstfmt->palette) { - map->palette_version = dstfmt->palette->version; + map->dst_palette_version = dstfmt->palette->version; } else { - map->palette_version = 0; + map->dst_palette_version = 0; + } + + if (srcfmt->palette) { + map->src_palette_version = srcfmt->palette->version; + } else { + map->src_palette_version = 0; } /* Choose your blitters wisely */ diff -r 2167a41feefe src/video/SDL_surface.c --- a/src/video/SDL_surface.c Mon Jun 06 12:20:04 2011 -0400 +++ b/src/video/SDL_surface.c Sun Jun 12 20:05:00 2011 +0200 @@ -494,7 +494,9 @@ /* Check to make sure the blit mapping is valid */ if ((src->map->dst != dst) || (dst->format->palette && - src->map->palette_version != dst->format->palette->version)) { + src->map->dst_palette_version != dst->format->palette->version) || + (src->format->palette && + src->map->src_palette_version != src->format->palette->version)) { if (SDL_MapSurface(src, dst) < 0) { return (-1); }