From 3899c021a14cb960e049e0ff1932810d256f1aa9 Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Fri, 14 May 1999 08:07:56 +0000 Subject: [PATCH] Check if in depth-conversion mode before returning an error message in IDirectDrawPaletteImpl_GetEntries. --- graphics/ddraw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/graphics/ddraw.c b/graphics/ddraw.c index 60939d83943..b213f1fa301 100644 --- a/graphics/ddraw.c +++ b/graphics/ddraw.c @@ -2013,7 +2013,10 @@ static HRESULT WINAPI IDirectDrawPaletteImpl_GetEntries( TRACE(ddraw,"(%p)->GetEntries(%08lx,%ld,%ld,%p)\n", This,x,start,count,palent); - if (!This->cm) /* should not happen */ { + /* No palette created and not in depth-convertion mode -> BUG ! */ + if ((This->cm == NULL) && + (This->ddraw->d.palette_convert == NULL)) + { FIXME(ddraw,"app tried to read colormap for non-palettized mode\n"); return DDERR_GENERIC; }