Browse Source

sys: fix uninitialised memory in File class.

legacy
Sam Hocevar 4 years ago
parent
commit
dd1d8fe4de
1 changed files with 4 additions and 9 deletions
  1. +4
    -9
      src/sys/file.cpp

+ 4
- 9
src/sys/file.cpp View File

@@ -46,11 +46,6 @@ class FileData
{ {
friend class File; friend class File;


FileData()
: m_refcount(0),
m_type(StreamType::File)
{ }

void Open(StreamType stream) void Open(StreamType stream)
{ {
if (m_type == StreamType::File || if (m_type == StreamType::File ||
@@ -211,12 +206,12 @@ class FileData


//----------------------- //-----------------------
#if __ANDROID__ #if __ANDROID__
AAsset *m_asset;
AAsset *m_asset = nullptr;
#elif HAVE_STDIO_H #elif HAVE_STDIO_H
FILE *m_fd;
FILE *m_fd = nullptr;
#endif #endif
std::atomic<int> m_refcount;
StreamType m_type;
std::atomic<int> m_refcount = 0;
StreamType m_type = StreamType::File;
struct stat m_stat; struct stat m_stat;
}; };




Loading…
Cancel
Save