VTFParser
Simple and modern library for parsing the Valve Texture Format
Loading...
Searching...
No Matches
check-bounds.hpp
1#pragma once
2
3#include "../errors.hpp"
4#include <cstddef>
5
6namespace VtfParser {
7 inline void checkBounds(size_t offset, size_t count, size_t rangeSize, const char* errorMessage) {
8 if (offset >= rangeSize || offset + count > rangeSize) {
9 throw Errors::OutOfBoundsAccess(errorMessage);
10 }
11 }
12}
Definition: VTFParser.hpp:6