From c81df74b4066a9c6d6f4c4565cbd0a7985f5e068 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 22 Jan 2020 15:37:52 +0900 Subject: [PATCH 1/1] Fix Coverity issue - If the variable 'pixelFormat' is deliberately set to RGB16F or RGB32F, then Pixel::GetBytesPerPixel() returns 12u or 24u. - Then, 'Out-of-bound' error may occur because the return value exceeds the scope of 'outputColor' array. Change-Id: I5674b20d8976b925e12444eb9fc611e0d5633f49 Signed-off-by: Seoyeon Kim --- dali-toolkit/devel-api/text/text-utils-devel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dali-toolkit/devel-api/text/text-utils-devel.cpp b/dali-toolkit/devel-api/text/text-utils-devel.cpp index fae3c10..fc8afb9 100755 --- a/dali-toolkit/devel-api/text/text-utils-devel.cpp +++ b/dali-toolkit/devel-api/text/text-utils-devel.cpp @@ -1241,7 +1241,7 @@ void UpdateBuffer(Devel::PixelBuffer src, Devel::PixelBuffer dst, unsigned int x } const unsigned int bytesPerPixel = Dali::Pixel::GetBytesPerPixel(pixelFormat); - if( bytesPerPixel == 0u ) + if( bytesPerPixel == 0u || bytesPerPixel == 12u || bytesPerPixel == 24u ) { return; } -- 2.7.4