| 10441 | } // anonymous namespace |
| 10442 | |
| 10443 | int ParseEXRVersionFromMemory(EXRVersion *version, const unsigned char *memory, |
| 10444 | size_t size) { |
| 10445 | if (version == NULL || memory == NULL) { |
| 10446 | return TINYEXR_ERROR_INVALID_ARGUMENT; |
| 10447 | } |
| 10448 | |
| 10449 | if (size < tinyexr::kEXRVersionSize) { |
| 10450 | return TINYEXR_ERROR_INVALID_DATA; |
| 10451 | } |
| 10452 | |
| 10453 | // Use Reader class for safer memory access |
| 10454 | tinyexr::Reader reader(memory, size, tinyexr::Endian::Little); |
| 10455 | int ret = ParseEXRVersionWithReader(version, reader); |
| 10456 | |
| 10457 | // Note: errors are accumulated in reader.errors() but not propagated |
| 10458 | // to maintain compatibility with existing API |
| 10459 | return ret; |
| 10460 | } |
| 10461 | |
| 10462 | int ParseEXRVersionFromFile(EXRVersion *version, const char *filename) { |
| 10463 | if (filename == NULL) { |
no test coverage detected