forked from enlightenment/efl
ecore-drm2: Fix potential SIGFPE when adding output mode
If we receive bad crtc info from libdrm, then we could end up with a SIGFPE here due to division by zero if info h/v total are not set. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
b7c7ce4ce0
commit
0ecf044080
|
@ -306,6 +306,10 @@ _output_mode_add(Ecore_Drm2_Output *output, const drmModeModeInfo *info)
|
|||
Ecore_Drm2_Output_Mode *mode;
|
||||
uint64_t refresh;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(info, NULL);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL((info->htotal > 0), NULL);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL((info->vtotal > 0), NULL);
|
||||
|
||||
mode = calloc(1, sizeof(Ecore_Drm2_Output_Mode));
|
||||
if (!mode) return NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue