Commit 5bd003ed authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: When creating a dib_info from a ddb, always make a copy of the colour map.

parent 2a5cabc2
...@@ -604,7 +604,7 @@ DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, ...@@ -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, ...@@ -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 ...@@ -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: ...@@ -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 ...@@ -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 );
......
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