fix memcpy pointer error
authorJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 8 Feb 2021 09:45:46 +0000 (18:45 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 8 Feb 2021 09:45:49 +0000 (18:45 +0900)
Change-Id: I1beeb94bf6810195198daf90552176dda37a6618
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/tdm_hwc.c
src/tdm_hwc_window.c
src/tdm_output.c

index a445fe2..11a7d5d 100644 (file)
@@ -1050,7 +1050,7 @@ tdm_hwc_get_property(tdm_hwc *hwc, uint32_t id, tdm_value *value)
                hal_tdm_value hvalue;
                ret = (tdm_error)hal_tdm_hwc_get_property((hal_tdm_hwc *)private_hwc->hwc_backend, id, &hvalue);
                if (ret == TDM_ERROR_NONE)
-                       memcpy(value->ptr, &hvalue.ptr, sizeof(tdm_value));
+                       memcpy(&value->ptr, &hvalue.ptr, sizeof(tdm_value));
        } else {
                if (!func_hwc->hwc_get_property) {
                        /* LCOV_EXCL_START */
index 157cefa..074131d 100644 (file)
@@ -468,7 +468,8 @@ tdm_hwc_window_get_property(tdm_hwc_window *hwc_window, unsigned int id, tdm_val
        if (private_module->use_hal_tdm) {
                hal_tdm_value hvalue;
                ret = hal_tdm_hwc_window_get_property((hal_tdm_hwc_window *)private_hwc_window->hwc_window_backend, id, &hvalue);
-               memcpy(value->ptr, &hvalue.ptr, sizeof(tdm_value));
+               if (ret == TDM_ERROR_NONE)
+                       memcpy(&value->ptr, &hvalue.ptr, sizeof(tdm_value));
        } else {
                if (!func_hwc_window->hwc_window_get_property) {
                        /* LCOV_EXCL_START */
index 3e1ef1c..9232de9 100644 (file)
@@ -951,7 +951,7 @@ tdm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value)
                hal_tdm_value hvalue;
                ret = (tdm_error)hal_tdm_output_get_property(private_output->output_backend, id, &hvalue);
                if (ret == TDM_ERROR_NONE)
-                       memcpy(value->ptr, &hvalue.ptr, sizeof(tdm_value));
+                       memcpy(&value->ptr, &hvalue.ptr, sizeof(tdm_value));
        } else {
                func_output = &private_module->func_output;