GDI: Don't crash when copying to an EMF from a NULL bitmap.

Alexandre Julliard julliard at winehq.org
Mon Feb 13 05:59:14 CST 2006


Mike McCormack <mike at codeweavers.com> writes:

> @@ -84,9 +84,14 @@ static BOOL EMFDRV_BitBlockTransfer( 
>      BITMAP  BM;
>      WORD nBPP;
>      LPBITMAPINFOHEADER lpBmiH;
> -    EMFDRV_PDEVICE* physDevSrc = (EMFDRV_PDEVICE*)devSrc;
> -    HBITMAP hBitmap = GetCurrentObject(physDevSrc->hdc, OBJ_BITMAP);
> +    EMFDRV_PDEVICE* physDevSrc;
> +    HBITMAP hBitmap;
>  
> +    physDevSrc = (EMFDRV_PDEVICE*)devSrc;
> +    if (!devSrc)
> +        return TRUE;

You still need to generate the EMF record, you can't just ignore it
and return TRUE.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list