ecore-drm2: Fix potential invalid access to output current_mode

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
Chris Michael 2016-05-11 09:43:53 -04:00
parent e934f546ad
commit 6697584fb9
1 changed files with 13 additions and 3 deletions

View File

@ -90,11 +90,21 @@ _output_event_send(Ecore_Drm2_Output *output)
ev->x = output->x;
ev->y = output->y;
ev->w = output->current_mode->width;
ev->h = output->current_mode->height;
if (output->current_mode)
{
ev->w = output->current_mode->width;
ev->h = output->current_mode->height;
ev->refresh = output->current_mode->refresh;
}
else
{
ev->w = output->ocrtc->width;
ev->h = output->ocrtc->height;
ev->refresh = 0;
}
ev->phys_width = output->pw;
ev->phys_height = output->ph;
ev->refresh = output->current_mode->refresh;
ev->scale = output->scale;
ev->subpixel = output->subpixel;