[ddraw/dsurface/dib.c] Check for NULL

Christian Costa titan.costa at wanadoo.fr
Wed Mar 9 12:42:03 CST 2005






> Message du 09/03/05 19:31
> De : "Paul Vriens" 
> A : "Christian Costa" 
> Copie à : "wine-devel at winehq.org" 
> Objet : Re: [ddraw/dsurface/dib.c] Check for NULL
> 
> On Wed, 2005-03-09 at 19:01, Christian Costa wrote:
> > > Message du 09/03/05 16:52
> > > De : "Paul Vriens" 
> > > A : "wine-patches at winehq.org" 
> > > Copie à : 
> > > Objet : [ddraw/dsurface/dib.c] Check for NULL
> > > 
> > > Hi,
> > > 
> > > the recent 'ddraw lock' changes crash Zoo Tycoon 1 Demo.
> > > 
> > > Changelog
> > > Check for NULL before touching src.
> > > 
> > > Cheers,
> > > 
> > > Paul.
> > > >
> > 
> > If src == NULL, you still need to check if the destination surface is not locked.
> > 
> > Bye,
> > Christian
> You mean:
> 
> if (This->locked) {
> WARN(" Surface is busy, returning DDERR_SURFACEBUSY\n");
> return DDERR_SURFACEBUSY;
> }
> 
> if (src != NULL) {
> if (((IDirectDrawSurfaceImpl *)src)->locked) {
> WARN(" Surface is busy, returning DDERR_SURFACEBUSY\n");
> return DDERR_SURFACEBUSY;
> }
> }
> 
> or something alike?

Yup! 

Bye,
Christian

PS: You can also do if ( src != NULL && ((IDirectDrawSurfaceImpl *)src)->locked) in the second test. ;-)






More information about the wine-devel mailing list