[Tizen] Workaround for remote image download 84/142384/1 accepted/tizen/unified/20170809.015312 submit/tizen/20170804.104325 submit/tizen/20170804.104701
authorDavid Steele <david.steele@samsung.com>
Wed, 2 Aug 2017 15:34:27 +0000 (16:34 +0100)
committerminho.sun <minho.sun@samsung.com>
Fri, 4 Aug 2017 00:21:48 +0000 (09:21 +0900)
File buffer is slightly too small, so the last byte doesn't get written to.
Extending the buffer size enables the correct data to be written.

Change-Id: Ieefe7580657cd516712c8fc912dbfa512019c1f7
Signed-off-by: David Steele <david.steele@samsung.com>
platform-abstractions/tizen/resource-loader/network/file-download.cpp

index ad50249..f4d654b 100755 (executable)
@@ -100,10 +100,10 @@ size_t ChunkLoader(char *ptr, size_t size, size_t nmemb, void *userdata)
 CURLcode DownloadFileDataWithSize( CURL* curlHandle, Dali::Vector<uint8_t>& dataBuffer, size_t dataSize )
 {
   CURLcode result( CURLE_OK );
-  dataBuffer.Resize( dataSize );
+  dataBuffer.Resize( dataSize+4);
 
   // create
-  Dali::Internal::Platform::FileCloser fileCloser( static_cast<void*>(&dataBuffer[0]), dataSize, "wb" );
+  Dali::Internal::Platform::FileCloser fileCloser( static_cast<void*>(&dataBuffer[0]), dataSize+4, "wb" );
   FILE* dataBufferFilePointer = fileCloser.GetFile();
   if( NULL != dataBufferFilePointer )
   {