diff options
author | HyunKyung Kim <hk310.kim@samsung.com> | 2020-06-10 16:03:30 +0900 |
---|---|---|
committer | HyunKyung Kim <hk310.kim@samsung.com> | 2020-06-11 10:01:05 +0900 |
commit | 43de865fe7e53a35022c66f0231ba54f15b4cb0e (patch) | |
tree | 3c4291042aa0b752b2e048651fb71b4ffb8809b2 /libhwc2.1/ExynosHWC.cpp | |
parent | 87fb074e71093fd847fde12df55e705ff408060a (diff) |
libhwc2.1: Check nullptr parameter of HWC API
Signed-off-by: HyunKyung Kim <hk310.kim@samsung.com>
Change-Id: Ib042aaf4b799580a86a9c7d21781b4ce00237290
Diffstat (limited to 'libhwc2.1/ExynosHWC.cpp')
-rw-r--r-- | libhwc2.1/ExynosHWC.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libhwc2.1/ExynosHWC.cpp b/libhwc2.1/ExynosHWC.cpp index 979e50d..4c3596f 100644 --- a/libhwc2.1/ExynosHWC.cpp +++ b/libhwc2.1/ExynosHWC.cpp @@ -223,6 +223,9 @@ int32_t exynos_createLayer(hwc2_device_t *dev, int32_t exynos_createVirtualDisplay(hwc2_device_t *dev, uint32_t width, uint32_t height, int32_t *format, hwc2_display_t *outDisplay) { + if (format == nullptr) + return HWC2_ERROR_BAD_PARAMETER; + ExynosDevice *exynosDevice = checkDevice(dev); *outDisplay = HWC_DISPLAY_VIRTUAL; @@ -593,6 +596,9 @@ int32_t exynos_setColorMode(hwc2_device_t *dev, hwc2_display_t display, int32_t int32_t exynos_setColorTransform(hwc2_device_t *dev, hwc2_display_t display, const float* matrix, int32_t hint) { + if (matrix == nullptr) + return HWC2_ERROR_BAD_PARAMETER; + ExynosDevice *exynosDevice = checkDevice(dev); if (exynosDevice) { @@ -900,6 +906,9 @@ int32_t exynos_setLayerPerFrameMetadata(hwc2_device_t *dev, hwc2_display_t displ hwc2_layer_t layer, uint32_t numElements, const int32_t* /*hw2_per_frame_metadata_key_t*/ keys, const float* metadata) { + if ((keys == nullptr) || (metadata == nullptr)) + return HWC2_ERROR_BAD_PARAMETER; + ExynosDevice *exynosDevice = checkDevice(dev); if (exynosDevice) { ExynosDisplay *exynosDisplay = checkDisplay(exynosDevice, display); @@ -1041,6 +1050,9 @@ int32_t exynos_setLayerPerFrameMetadataBlobs(hwc2_device_t* dev, hwc2_display_t hwc2_layer_t layer, uint32_t numElements, const int32_t* keys, const uint32_t* sizes, const uint8_t* metadata) { + if ((keys == nullptr) || (sizes == nullptr) || (metadata == nullptr)) + return HWC2_ERROR_BAD_PARAMETER; + ExynosDevice *exynosDevice = checkDevice(dev); if (exynosDevice) { |