diff options
Diffstat (limited to 'source/core/slang-riff.h')
| -rw-r--r-- | source/core/slang-riff.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/core/slang-riff.h b/source/core/slang-riff.h index 99d078625..61e6eed1e 100644 --- a/source/core/slang-riff.h +++ b/source/core/slang-riff.h @@ -109,8 +109,8 @@ public: { return SLANG_FAIL; } - // Make sure the alignment is plausible - SLANG_ASSERT((size_t(m_cur) & (SLANG_ALIGN_OF(T) - 1)) == 0); + // TODO: consider whether this type should enforce alignment. + // SLANG_ASSERT((size_t(m_cur) & (SLANG_ALIGN_OF(T) - 1)) == 0); ::memcpy(&out, m_cur, sizeof(T)); m_cur += sizeof(T); return SLANG_OK; @@ -128,6 +128,16 @@ public: { } + SlangResult skip(size_t size) + { + if (m_cur + size > m_end) + { + return SLANG_FAIL; + } + m_cur += size; + return SLANG_OK; + } + protected: const uint8_t* m_start; const uint8_t* m_end; @@ -248,6 +258,9 @@ public: /// Find all contained that match the type void findContained(FourCC type, List<ListChunk*>& out); + /// Find all contained that match the type + void findContained(FourCC type, List<DataChunk*>& out); + /// Find the list (including self) that matches subtype recursively ListChunk* findListRec(FourCC subType); |
