From 319dc18780d460662b9ce398def3681f935d5a86 Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Mon, 29 Jul 2019 15:28:39 +0900 Subject: [PATCH] haltest: check calloc fail Change-Id: I4395553909638d77b870288938f6436deafbd1f9 Signed-off-by: Junkyeong Kim --- haltests/src/tc_tdm_backend_pp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/haltests/src/tc_tdm_backend_pp.cpp b/haltests/src/tc_tdm_backend_pp.cpp index f739d96..e1087bc 100644 --- a/haltests/src/tc_tdm_backend_pp.cpp +++ b/haltests/src/tc_tdm_backend_pp.cpp @@ -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 */ -- 2.7.4