Fix svg memory issue
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / svg / svg-visual.cpp
index a3d3685..fccd5e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -208,6 +208,7 @@ void SvgVisual::ParseFromUrl( const VisualUrl& imageUrl )
     Dali::Vector<char> buffer;
     if ( Dali::FileLoader::ReadFile( mImageUrl.GetUrl(), buffer ) )
     {
     Dali::Vector<char> buffer;
     if ( Dali::FileLoader::ReadFile( mImageUrl.GetUrl(), buffer ) )
     {
+      buffer.PushBack( '\0' );
       mParsedImage = nsvgParse( buffer.Begin(), UNITS, meanDpi );
     }
   }
       mParsedImage = nsvgParse( buffer.Begin(), UNITS, meanDpi );
     }
   }