e_comp: check the buffer minimum size
authorBoram Park <boram1288.park@samsung.com>
Thu, 22 Jun 2017 05:33:22 +0000 (14:33 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 5 Jul 2017 02:59:42 +0000 (11:59 +0900)
Change-Id: Ic39181c17b1b1d3b3f28424890b4265adca771a0

src/bin/e_comp.c

index 69e916f923d2b5581a6efe7061f019c395587f1b..41d766dc24dcb5673fc109ace39f80aff0dd9833 100644 (file)
@@ -276,7 +276,7 @@ _hwc_available_get(E_Client *ec)
 {
    E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
    E_Output *eout;
-   int transform = 0;
+   int transform = 0, minw = 0, minh = 0;
 
    if ((!cdata) ||
        (!cdata->buffer_ref.buffer) ||
@@ -309,6 +309,15 @@ _hwc_available_get(E_Client *ec)
     * can't show it to HW overlay directly.
     */
    eout = e_output_find(ec->zone->output_id);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(eout, EINA_FALSE);
+
+   tdm_output_get_available_size(eout->toutput, &minw, &minh, NULL, NULL, NULL);
+
+   if ((minw > 0) && (minw > cdata->buffer_ref.buffer->w))
+     return EINA_FALSE;
+   if ((minh > 0) && (minh > cdata->buffer_ref.buffer->h))
+     return EINA_FALSE;
+
    transform = cdata->scaler.buffer_viewport.buffer.transform;
    if ((eout->config.rotation / 90) != transform)
      return EINA_FALSE;