server: check null of current mode for voutput set mode
[platform/core/uifw/libtdm.git] / src / tdm_server.c
index adddc5b..6c4c6ab 100644 (file)
@@ -897,7 +897,7 @@ _tdm_voutput_cb_set_mode(struct wl_client *client, struct wl_resource *resource,
                return;
        }
 
-       if ((mode->hdisplay != current_mode->hdisplay) || (mode->vdisplay != current_mode->vdisplay)) {
+       if (current_mode && ((mode->hdisplay != current_mode->hdisplay) || (mode->vdisplay != current_mode->vdisplay))) {
                LIST_FOR_EACH_ENTRY_SAFE(vb, vbb, &voutput_info->buffer_list, link) {
                        if (vb->wl_buffer == voutput_info->attach_buffer->wl_buffer)
                                voutput_info->attach_buffer->need_reset = 1;