haltest: check calloc fail 13/211013/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 29 Jul 2019 06:28:39 +0000 (15:28 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 29 Jul 2019 06:28:46 +0000 (15:28 +0900)
Change-Id: I4395553909638d77b870288938f6436deafbd1f9
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
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 */