summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/tools/texturec
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/tools/texturec')
-rw-r--r--3rdparty/bgfx/tools/texturec/texturec.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/3rdparty/bgfx/tools/texturec/texturec.cpp b/3rdparty/bgfx/tools/texturec/texturec.cpp
index c1c271fddbc..687ccf82fdb 100644
--- a/3rdparty/bgfx/tools/texturec/texturec.cpp
+++ b/3rdparty/bgfx/tools/texturec/texturec.cpp
@@ -570,10 +570,13 @@ int main(int _argc, const char* _argv[])
const bool normalMap = cmdLine.hasArg('n', "normalmap");
const bool iqa = cmdLine.hasArg('\0', "iqa");
- uint32_t size = (uint32_t)bx::getSize(&reader);
- const bgfx::Memory* mem = bgfx::alloc(size);
- bx::read(&reader, mem->data, mem->size);
- bx::close(&reader);
+ const bgfx::Memory* mem;
+ {
+ uint32_t size = (uint32_t)bx::getSize(&reader);
+ mem = bgfx::alloc(size);
+ bx::read(&reader, mem->data, mem->size);
+ bx::close(&reader);
+ }
{
using namespace bgfx;