mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-04 15:40:18 +01:00
Added code to check for null pointers on fb* invocations
(cherry picked from commit6f441d79c7) (cherry picked from commit1e1073334a)
This commit is contained in:
parent
5dcdb2f748
commit
ac1009fdcb
1 changed files with 7 additions and 0 deletions
7
fb/fb.h
7
fb/fb.h
|
|
@ -169,6 +169,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);
|
||||
|
|
@ -713,6 +718,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) { \
|
||||
|
|
@ -730,6 +736,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); \
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue