diff options
Diffstat (limited to 'src/lua/modules/graphics/graphics.cpp')
-rw-r--r-- | src/lua/modules/graphics/graphics.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/modules/graphics/graphics.cpp b/src/lua/modules/graphics/graphics.cpp index ada4754..4d597ae 100644 --- a/src/lua/modules/graphics/graphics.cpp +++ b/src/lua/modules/graphics/graphics.cpp @@ -110,7 +110,7 @@ namespace lua error(L, "No such image file %s", f); goto fail; } - Buffer b; + Buffer b = {}; if (!fs->read(f, &b)) { error(L, "Failed to read image %s", f); @@ -459,13 +459,13 @@ namespace lua { const char* path = luax_checkstring(L, 1); Filesystem* fs = Filesystem::get(); - Buffer b = {}; if (!fs->exists(path)) { error(L, "No such font %s\n", path); luax_pushnil(L); return 1; } + Buffer b = {}; fs->read(path, &b); font->loadMemory((const unsigned char*)b.data); } |