fix texture converting crash 89/211889/2
authorjunqing.ma <junqing.ma@samsung.com>
Sat, 10 Aug 2019 08:38:31 +0000 (16:38 +0800)
committerjunqing.ma <junqing.ma@samsung.com>
Fri, 16 Aug 2019 08:48:19 +0000 (16:48 +0800)
Change-Id: I6bcfeea9ae67e73ca488ea654ddb02bacc0daa45

dali/internal/render/renderers/render-texture.cpp

index d26f00d..a2f11bc 100644 (file)
@@ -787,7 +787,8 @@ void Texture::Upload( Context& context, PixelDataPtr pixelData, const Internal::
   if( context.TextureRequiresConverting( glFormat, mGlFormat, isSubImage ) )
   {
     uint32_t dataSize = static_cast< uint32_t >( params.width ) * params.height;
-    tempBuffer.reserve( dataSize * 4u );
+    //reserve() does not allocate the memory on some systems so can crash if not populated using push_back
+    tempBuffer.resize( dataSize * 4u );
     for( uint32_t i = 0u; i < dataSize; ++i )
     {
       tempBuffer[i*4u]   = buffer[i*3u];