tdm_output_hwc_set_client_target_buffer: allow pass 0 for num_wnds
[platform/core/uifw/libtdm.git] / src / tdm_output.c
index 27c83ae..76192a2 100644 (file)
@@ -1751,6 +1751,15 @@ tdm_output_hwc_set_client_target_buffer(tdm_output *output, tbm_surface_h target
                _tdm_target_window_dump_buffer((tdm_private_output *)output, target_buffer);
        /* LCOV_EXCL_STOP */
 
+       if (num_wnds == 0) {
+               ret = func_output->output_hwc_set_client_target_buffer(private_output->output_backend, target_buffer,
+                                       damage, NULL, 0);
+
+               _pthread_mutex_unlock(&private_display->lock);
+
+               return ret;
+       }
+
        composited_wnds_backend = calloc(num_wnds, sizeof(tdm_hwc_window *));
        if (!composited_wnds_backend) {
                /* LCOV_EXCL_START */