From: seungho baek Date: Wed, 8 Mar 2023 06:23:52 +0000 (+0900) Subject: Make safe conversion from uint32_t to streamsize X-Git-Tag: dali_2.2.17~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24ca3d64aaab0f2224ceaf08e69a01a34d061587;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Make safe conversion from uint32_t to streamsize Change-Id: I575d11e330723fe53528a72b3abfaccef4c39523 Signed-off-by: seungho baek --- diff --git a/dali-scene3d/internal/loader/glb-loader-impl.cpp b/dali-scene3d/internal/loader/glb-loader-impl.cpp index 4ab9f70922..deaa91e9fa 100644 --- a/dali-scene3d/internal/loader/glb-loader-impl.cpp +++ b/dali-scene3d/internal/loader/glb-loader-impl.cpp @@ -85,7 +85,7 @@ bool GlbLoaderImpl::LoadModel(const std::string& url, Dali::Scene3D::Loader::Loa std::vector jsonChunkData; jsonChunkData.resize(jsonChunkHeader.chunkLength); - stream.read(reinterpret_cast(&jsonChunkData[0]), jsonChunkHeader.chunkLength); + stream.read(reinterpret_cast(&jsonChunkData[0]), static_cast(static_cast(jsonChunkHeader.chunkLength))); std::string gltfText(jsonChunkData.begin(), jsonChunkData.end()); uint32_t binaryChunkOffset = sizeof(GlbHeader) + sizeof(ChunkHeader) + jsonChunkHeader.chunkLength; @@ -102,7 +102,7 @@ bool GlbLoaderImpl::LoadModel(const std::string& url, Dali::Scene3D::Loader::Loa } binaryChunkData.resize(binaryChunkHeader.chunkLength); - stream.read(reinterpret_cast(&binaryChunkData[0]), binaryChunkHeader.chunkLength); + stream.read(reinterpret_cast(&binaryChunkData[0]), static_cast(static_cast(binaryChunkHeader.chunkLength))); } json::unique_ptr root(json_parse(gltfText.c_str(), gltfText.size()));