sna: NameForAtom may return NULL

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-06-01 23:22:31 +01:00
parent 7867bff00c
commit 2c5647a18e
2 changed files with 3 additions and 1 deletions

View File

@ -1509,6 +1509,8 @@ sna_output_set_property(xf86OutputPtr output, Atom property,
return FALSE;
memcpy(&atom, value->data, 4);
name = NameForAtom(atom);
if (name == NULL)
return FALSE;
/* search for matching name string, then set its value down */
for (j = 0; j < p->mode_prop->count_enums; j++) {

View File

@ -387,7 +387,7 @@ XF86VideoAdaptorPtr sna_video_textured_setup(struct sna *sna,
return NULL;
}
if (sna->kgem.wedged) {
if (wedged(sna)) {
xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING,
"cannot enable XVideo whilst the GPU is wedged\n");
return FALSE;