haltest: check calloc fail
[platform/core/uifw/libtdm.git] / haltests / src / tc_tdm_backend_pp.cpp
index f739d96..e1087bc 100644 (file)
@@ -196,6 +196,7 @@ bool TDMBackendPP::FindLayerUnderPrimary(void)
 
        if (tc_tdm_output_is_hwc_enable(output)) {
                pp_formats = (tbm_format *)calloc(1, sizeof(tbm_format) * 2);
+               TDM_UT_RETURN_FALSE_IF_FAIL(pp_formats != NULL);
                pp_formats[0] = TBM_FORMAT_NV12;
                pp_formats[1] = TBM_FORMAT_YUV420;
                dst_formats = pp_formats;
@@ -239,6 +240,7 @@ bool TDMBackendPP::FindLayerOverPrimary(void)
 
        if (tc_tdm_output_is_hwc_enable(output)) {
                pp_formats = (tbm_format *)calloc(1, sizeof(tbm_format) * 2);
+               TDM_UT_RETURN_FALSE_IF_FAIL(pp_formats != NULL);
                pp_formats[0] = TBM_FORMAT_ARGB8888;
                pp_formats[1] = TBM_FORMAT_XRGB8888;
                dst_formats = formats;
@@ -920,4 +922,4 @@ INSTANTIATE_TEST_CASE_P(TDMBackendPPParams,
                                                Values(TDM_DEFAULT_MODULE));
 #endif
 
-/* LCOV_EXCL_END */
\ No newline at end of file
+/* LCOV_EXCL_END */