glamor: NULL-protect GLAMOR_PIXMAP_PRIV_HAS_FBO()
It could potentially be called with NULL pointer, but can't handle it, so when that happens, it's a bug. Adding a BUG_RETURN_VAL() call here, so it's giving us a hint where to look at. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
8b970b4bde
commit
5fd11ec4a6
|
@ -32,6 +32,8 @@
|
|||
#ifndef __GLAMOR_UTILS_H__
|
||||
#define __GLAMOR_UTILS_H__
|
||||
|
||||
#include "os/bug_priv.h"
|
||||
|
||||
#include "glamor_prepare.h"
|
||||
#include "mipict.h"
|
||||
|
||||
|
@ -570,7 +572,10 @@
|
|||
&& (_w_) <= _glamor_->max_fbo_size \
|
||||
&& (_h_) <= _glamor_->max_fbo_size)
|
||||
|
||||
#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL)
|
||||
static inline Bool GLAMOR_PIXMAP_PRIV_HAS_FBO(glamor_pixmap_private *pixmap_priv) {
|
||||
BUG_RETURN_VAL(!pixmap_priv, FALSE);
|
||||
return pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL;
|
||||
}
|
||||
|
||||
#define REVERT_NONE 0
|
||||
#define REVERT_NORMAL 1
|
||||
|
|
Loading…
Reference in New Issue