gdi32: When creating a dib_info from a ddb, always make a copy of the colour map.
This commit is contained in:
parent
2a5cabc22d
commit
5bd003edaa
|
@ -604,7 +604,7 @@ DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
||||||
struct gdi_image_bits *bits, struct bitblt_coords *src )
|
struct gdi_image_bits *bits, struct bitblt_coords *src )
|
||||||
{
|
{
|
||||||
DWORD ret = ERROR_SUCCESS;
|
DWORD ret = ERROR_SUCCESS;
|
||||||
dib_info *dib, stand_alone;
|
dib_info *dib = NULL, stand_alone;
|
||||||
|
|
||||||
TRACE( "%p %p %p\n", dev, hbitmap, info );
|
TRACE( "%p %p %p\n", dev, hbitmap, info );
|
||||||
|
|
||||||
|
@ -651,7 +651,12 @@ DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (hbitmap) GDI_ReleaseObj( hbitmap );
|
if (hbitmap)
|
||||||
|
{
|
||||||
|
if (dib) free_dib_info( dib );
|
||||||
|
GDI_ReleaseObj( hbitmap );
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -707,7 +712,7 @@ DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop )
|
struct bitblt_coords *dst, DWORD rop )
|
||||||
{
|
{
|
||||||
dib_info *dib, stand_alone;
|
dib_info *dib = NULL, stand_alone;
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
dib_info src_dib;
|
dib_info src_dib;
|
||||||
HRGN saved_clip = NULL;
|
HRGN saved_clip = NULL;
|
||||||
|
@ -780,7 +785,11 @@ update_format:
|
||||||
ret = ERROR_BAD_FORMAT;
|
ret = ERROR_BAD_FORMAT;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (hbitmap) GDI_ReleaseObj( hbitmap );
|
if (hbitmap)
|
||||||
|
{
|
||||||
|
if (dib) free_dib_info( dib );
|
||||||
|
GDI_ReleaseObj( hbitmap );
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,8 @@ BOOL init_dib_info_from_bitmapobj(dib_info *dib, BITMAPOBJ *bmp, enum dib_info_f
|
||||||
BITMAPINFO *info = (BITMAPINFO *)buffer;
|
BITMAPINFO *info = (BITMAPINFO *)buffer;
|
||||||
|
|
||||||
get_ddb_bitmapinfo( bmp, info );
|
get_ddb_bitmapinfo( bmp, info );
|
||||||
return init_dib_info_from_bitmapinfo( dib, info, bmp->bitmap.bmBits, flags );
|
return init_dib_info_from_bitmapinfo( dib, info, bmp->bitmap.bmBits,
|
||||||
|
flags | private_color_table );
|
||||||
}
|
}
|
||||||
return init_dib_info( dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields,
|
return init_dib_info( dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields,
|
||||||
bmp->color_table, bmp->nb_colors, bmp->dib->dsBm.bmBits, flags );
|
bmp->color_table, bmp->nb_colors, bmp->dib->dsBm.bmBits, flags );
|
||||||
|
|
Loading…
Reference in New Issue