wined3d: Prevent crash when blit_priv is NULL.

Roderick Colenbrander thunderbird2k at gmail.com
Sun Mar 20 23:48:43 CDT 2011


Hi Konrad,

You should try to figure out why blit_priv is NULL. That's the real
issue. What drivers are you using? Do they support arb fragment
program? Right now we may still call arbfp_blit_surface when the
extension isn't around (was working on this a year ago, haven't had
time since then :( ), this could explain why there is no priv_data
since in ffp_blit_alloc we don't do any allocation.

Roderick

On Sun, Mar 20, 2011 at 3:58 AM, Konrad Rzepecki
<hannibal at astral.lodz.pl> wrote:
> Might&Magic VII from gog.com crash in bink movie plaing:
>
> Backtrace:
> =>0 0x7e70c4b9 arbfp_blit_set+0x28b(blit_priv=0x0(nil), gl_info=0x135b08, surface=0x1dc788) [/mnt/skopia/devel/winegit/wine/dlls/wined3d/arb_program_shader.c:7058] in wined3d (0x0033f98c)
>  1 0x7e70d3db arbfp_blit_surface+0xa2(device=0x16cdc0, src_surface=0x1dc788, src_rect=0x33fa74, dst_surface=0x168140, dst_rect_in=0x33fa84, blit_op=BLIT_OP_BLIT, Filter=0x2) [/mnt/skopia/devel/winegit/wine/dlls/wined3d/arb_program_shader.c:7192] in wined3d (0x0033f9dc)
>  2 0x7e7d28f7 IWineD3DSurfaceImpl_BltOverride+0xf1b(dst_surface=0x168140, DestRect=0x33fcf8, src_surface=0x1dc788, SrcRect=0x33fce8, flags=0x1000000, DDBltFx=(nil), Filter=WINED3DTEXF_LINEAR) [/mnt/skopia/devel/winegit/wine/dlls/wined3d/surface.c:3787] in wined3d (0x0033fbac)
>  3 0x7e7d3013 IWineD3DSurfaceImpl_Blt+0x29e(iface=0x168140, DestRect=0x33fcf8, src_surface=0x1dc788, SrcRect=0x33fce8, flags=0x1000000, DDBltFx=(nil), Filter=WINED3DTEXF_LINEAR) [/mnt/skopia/devel/winegit/wine/dlls/wined3d/surface.c:3930] in wined3d (0x0033fc2c)
>  4 0x7e8687f2 ddraw_surface7_Blt+0x380(iface=0x135308, DestRect=0x33fcf8, SrcSurface=0x1dc560, SrcRect=0x33fce8, Flags=0x1000000, DDBltFx=(nil)) [/mnt/skopia/devel/winegit/wine/dlls/ddraw/surface.c:908] in ddraw (0x0033fc9c)
>  5 0x004a18cd in mm7-rel (+0xa18cc) (0x0033fcc8)
>  6 0x004beda4 in mm7-rel (+0xbeda3) (0x0033fd08)
>  7 0x004be721 in mm7-rel (+0xbe720) (0x00000000)
> ---
>  dlls/wined3d/surface.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
> index 745bd77..baa032b 100644
> --- a/dlls/wined3d/surface.c
> +++ b/dlls/wined3d/surface.c
> @@ -3924,8 +3924,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT
>     }
>
>     /* Special cases for RenderTargets */
> -    if ((This->resource.usage & WINED3DUSAGE_RENDERTARGET)
> -            || (src && (src->resource.usage & WINED3DUSAGE_RENDERTARGET)))
> +    if (This->resource.device->blit_priv && ((This->resource.usage & WINED3DUSAGE_RENDERTARGET)
> +            || (src && (src->resource.usage & WINED3DUSAGE_RENDERTARGET))))
>     {
>         if (SUCCEEDED(IWineD3DSurfaceImpl_BltOverride(This, DestRect, src, SrcRect, flags, DDBltFx, Filter)))
>             return WINED3D_OK;
> --
> 1.7.4.1
>
>
>



More information about the wine-devel mailing list