Fix mask creation for thumbnails.

svn path=/trunk/netsurf/; revision=2806
This commit is contained in:
Richard Wilson 2006-08-04 19:14:40 +00:00
parent b2ae3b22c7
commit 0fa805df8f
1 changed files with 5 additions and 3 deletions

View File

@ -178,8 +178,10 @@ osspriteop_area *thumbnail_convert_8bpp(struct bitmap *bitmap)
if (sprite_header->image != sprite_header->mask) {
/* build the sprite mask from the alpha channel */
unsigned *dp = (unsigned*)bitmap_get_buffer(bitmap);
int h = bitmap_get_width(bitmap);
int w = bitmap_get_height(bitmap);
if (!dp)
return sprite_area;
int w = bitmap_get_width(bitmap);
int h = bitmap_get_height(bitmap);
int dp_offset = bitmap_get_rowstride(bitmap) / 4 - w;
int mp_offset = ((sprite_header->width + 1) * 4) - w;
byte *mp = (byte*)sprite_header + sprite_header->mask;