fix texture converting crash
[platform/core/uifw/dali-core.git] / 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];