From d1eae130ecfcd755fc5d549b96743ac8f9785df2 Mon Sep 17 00:00:00 2001 From: Taehwan Kim Date: Wed, 13 Feb 2013 02:10:34 +0000 Subject: [PATCH] libexynosutils: resolved prevent defect - 16055 : Control flow issues Change-Id: I528b0ca221e4423ba11189e5966ac3b1ecb146cb Signed-off-by: Taehwan Kim --- libexynosutils/exynos5_format_v4l2.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/libexynosutils/exynos5_format_v4l2.c b/libexynosutils/exynos5_format_v4l2.c index c80622f..24f6097 100644 --- a/libexynosutils/exynos5_format_v4l2.c +++ b/libexynosutils/exynos5_format_v4l2.c @@ -351,16 +351,17 @@ unsigned int FRAME_SIZE( } int PLANAR_FRAME_SIZE(int hal_pixel_format, int width, int height, - unsigned int *luma_size, unsigned int *chroma_size) + unsigned int *luma_size, unsigned int *chroma_size) { - unsigned int size = 0; + unsigned int size = 0; switch(hal_pixel_format) { case HAL_PIXEL_FORMAT_EXYNOS_YV12: case HAL_PIXEL_FORMAT_YCbCr_420_P: size = width * height; - *luma_size = size; - *chroma_size = size >> 2; + *luma_size = size; + *chroma_size = size >> 2; + break; case HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP: case HAL_PIXEL_FORMAT_YCrCb_420_SP: case HAL_PIXEL_FORMAT_YCbCr_420_I: @@ -369,22 +370,23 @@ int PLANAR_FRAME_SIZE(int hal_pixel_format, int width, int height, case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP: case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP: size = width * height; - *luma_size = size; - *chroma_size = (size >> 2) << 1; + *luma_size = size; + *chroma_size = (size >> 2) << 1; break; case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED: *luma_size = ALIGN_TO_8KB(ALIGN_TO_128B(width) * ALIGN_TO_32B(height)); - *chroma_size = ALIGN_TO_8KB(ALIGN_TO_128B(width) * - ALIGN_TO_32B(height >> 1)); - break; + *chroma_size = ALIGN_TO_8KB(ALIGN_TO_128B(width) * + ALIGN_TO_32B(height >> 1)); + break; case HAL_PIXEL_FORMAT_YV12: size = ALIGN(width, 16) * height; *luma_size = size + ALIGN(width / 2, 16) * height; - break; - + break; default: - *luma_size = FRAME_SIZE(hal_pixel_format, width, height); + *luma_size = FRAME_SIZE(hal_pixel_format, width, height); + break; } + return 0; } -- 2.20.1