From: Joogab Yun Date: Tue, 23 Oct 2018 08:09:09 +0000 (+0900) Subject: fixed crash issue X-Git-Tag: dali_1.3.47~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=91a8793e9d136c300cbd2c4f713ab60effcb6db1;hp=d4ba78a09cb848bbb8712e72eb21113fed6228da fixed crash issue If colorsBuffer and colorIndexBuffer are null, then crash occurs. so if useDefaultColor is true, colorIndex must be 0u. (gdb)bt full #5 Dali::Toolkit::Text::Typesetter::CreateImageBuffer (this=this@entry=0x9b9f78, bufferWidth=bufferWidth@entry=166, bufferHeight=bufferHeight@entry=38, style=style@entry=Dali::Toolkit::Text::Typesetter::STYLE_NONE, ignoreHorizontalAlignment=ignoreHorizontalAlignment@entry=true, pixelFormat=pixelFormat@entry=Dali::Pixel::RGBA8888, horizontalOffset=, horizontalOffset@entry=0, verticalOffset=, verticalOffset@entry=0, fromGlyphIndex=, fromGlyphIndex@entry=0, toGlyphIndex=, toGlyphIndex@entry=5) at /usr/src/debug/dali-toolkit-1.3.41/build/tizen/dali-toolkit/../../../dali-toolkit/internal/text/rendering/text-typesetter.cpp:640 color = glyphInfo = 0x90ab28 position = 0x964330 glyphIndex = 0 line = @0x83d4f0: {glyphRun = {glyphIndex = 0, numberOfGlyphs = 6}, characterRun = {characterIndex = 0, numberOfCharacters = 6}, width = 115, ascender = 28, descender = -9, extraLength = 0, alignmentOffset = 0, lineSpacing = 0, direction = false, ellipsis = false} outlineWidth = 0 currentUnderlinePosition = currentUnderlineThickness = 0 lastUnderlinedFontId = 0 underlineEnabled = false lineExtentLeft = 2 lineExtentRight = 21 baseline = 0 underlineHeight = 0 underlineColor = @0x8e0358: {static ONE = {static ONE = , static XAXIS = {static ONE = , static XAXIS = , static YAXIS = {static ONE = , static XAXIS = , static YAXIS = , static ZAXIS = {static ONE = , static XAXIS = , static YAXIS = , static ZAXIS = , static ZERO = {static ONE = , static XAXIS = , static YAXIS = , static ZAXIS = , static ZERO = , {x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}, {x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 1, b = 1, p = 1}, {w = 0, a = 0, q = 0}}, static ZERO = , {x = 0, r = 0, s = 0}, {y = 1, g = 1, t = 1}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}, static ZAXIS = , static ZERO = , {x = 1, r = 1, s = 1}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}, static YAXIS = , static ZAXIS = , static ZERO = , {x = 1, r = 1, s = 1}, {y = 1, g = 1, t = 1}, {z = 1, b = 1, p = 1}, {w = 1, a = 1, q = 1}}, static XAXIS = , static YAXIS = , static ZAXIS = , static ZERO = , {x = 1, r = 1, s = 1}, {y = 1, g = 1, t = 1}, {z = 1, b = 1, p = 1}, {w = 1, a = 1, q = 1}} numberOfUnderlineRuns = underlineRuns = {> = { = {mData = 0x0}, }, } thereAreUnderlinedGlyphs = maxUnderlineThickness = 0 lineIndex = 0 modelNumberOfLines = 1 modelLinesBuffer = numberOfGlyphs = 6 glyphsBuffer = 0x90ab28 positionBuffer = 0x964330 colorsBuffer = 0x0 colorIndexBuffer = 0x0 useDefaultColor = true defaultColor = @0x8e0338: {static ONE = {static ONE = , static XAXIS = {static ONE = , static XAXIS = , static YAXIS = {static ONE = , static XAXIS = , static YAXIS = , static ZAXIS = {static ONE = , static XAXIS = , static YAXIS = , static ZAXIS = , static ZERO = {static ONE = , static XAXIS = , static YAXIS = , static ZAXIS = , static ZERO = , {x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}, {x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 1, b = 1, p = 1}, {w = 0, a = 0, q = 0}}, static ZERO = , {x = 0, r = 0, s = 0}, {y = 1, g = 1, t = 1}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}, static ZAXIS = , static ZERO = , {x = 1, r = 1, s = 1}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}, static YAXIS = , static ZAXIS = , static ZERO = , {x = 1, r = 1, s = 1}, {y = 1, g = 1, t = 1}, {z = 1, b = 1, p = 1}, {w = 1, a = 1, q = 1}}, static XAXIS = , static YAXIS = , static ZAXIS = , static ZERO = , {x = 1, r = 1, s = 1}, {y = 1, g = 1, t = 1}, {z = 1, b = 1, p = 1}, {w = 1, a = 1, q = 1}} glyphData = {bitmapBuffer = { = {mObjectHandle = {mPtr = 0x9b9f48}}, }, position = 0x6, glyphBitmap = {buffer = 0x0, width = 0, height = 0, format = Dali::Pixel::A8}, width = 166, height = 38, horizontalOffset = 0, verticalOffset = 28} fontClient = { = {mObjectHandle = {mPtr = 0x72bfd0}}, static DEFAULT_POINT_SIZE = 1767076981} Change-Id: Ia68a0409afecb8c008ccade6e1ce75334bb92ab2 --- diff --git a/dali-toolkit/internal/text/rendering/text-typesetter.cpp b/dali-toolkit/internal/text/rendering/text-typesetter.cpp index 0e149d7..8018054 100755 --- a/dali-toolkit/internal/text/rendering/text-typesetter.cpp +++ b/dali-toolkit/internal/text/rendering/text-typesetter.cpp @@ -637,7 +637,7 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth } // Retrieves the glyph's color. - const ColorIndex colorIndex = *( colorIndexBuffer + glyphIndex ); + const ColorIndex colorIndex = useDefaultColor ? 0u : *( colorIndexBuffer + glyphIndex ); Vector4 color; if ( style == Typesetter::STYLE_SHADOW )