Added code to check for null pointers on fb* invocations

This commit is contained in:
Ben Byer 2007-12-07 22:26:17 -08:00
parent e5f54f122b
commit 6f441d79c7

View File

@ -133,6 +133,11 @@ typedef CARD32 FbStip;
typedef int FbStride;
#define CHECK_NULL(ptr) \
if ((ptr) == NULL) {\
ErrorF("%s:%d: null pointer\n", __FILE__, __LINE__); \
return; \
}
#ifdef FB_DEBUG
extern void fbValidateDrawable(DrawablePtr d);
@ -677,6 +682,7 @@ typedef struct {
(pointer) = (FbBits *) _pPix->devPrivate.ptr; \
(stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
CHECK_NULL(pointer); \
}
#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
@ -693,6 +699,7 @@ typedef struct {
(pointer) = (FbStip *) _pPix->devPrivate.ptr; \
(stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
CHECK_NULL(pointer); \
}
/*