| 11 | #define MAGIC 0xDEADBEE1 |
| 12 | |
| 13 | bool basis_file::open(const uint8_t *buffer, uint32_t newByteLength) { |
| 14 | m_file = buffer; |
| 15 | byteLength = newByteLength; |
| 16 | |
| 17 | if (!m_transcoder.validate_header(buffer, newByteLength)) { |
| 18 | m_file = nullptr; |
| 19 | byteLength = 0; |
| 20 | return false; |
| 21 | } |
| 22 | |
| 23 | if (!m_transcoder.get_file_info(m_file, byteLength, fileinfo)) |
| 24 | { |
| 25 | return false; |
| 26 | } |
| 27 | |
| 28 | // Initialized after validation |
| 29 | m_magic = MAGIC; |
| 30 | return true; |
| 31 | } |
| 32 | |
| 33 | void basis_file::close() { |
| 34 | assert(m_magic == MAGIC); |
no test coverage detected