mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
egl/dri2: Prevent uninitialized variable dereference.
This commit is contained in:
parent
6c26072bd1
commit
4a47d6d46b
1 changed files with 5 additions and 2 deletions
|
|
@ -205,8 +205,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
|||
*/
|
||||
num_configs = 0;
|
||||
}
|
||||
|
||||
if (num_configs == 0) {
|
||||
else if (num_configs == 0) {
|
||||
conf = malloc(sizeof *conf);
|
||||
if (conf == NULL)
|
||||
return NULL;
|
||||
|
|
@ -224,6 +223,10 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
|||
|
||||
_eglLinkConfig(&conf->base);
|
||||
}
|
||||
else {
|
||||
assert(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
conf->base.SurfaceType |= surface_type & (!double_buffer ? EGL_PIXMAP_BIT:
|
||||
(EGL_WINDOW_BIT | EGL_PBUFFER_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue