MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SoundLoadMemory

Function SoundLoadMemory

engine/Poseidon/Audio/Streaming/WaveStream.cpp:228–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228WaveStream* SoundLoadMemory(const void* data, size_t size, const char* ext)
229{
230 if (!data || size == 0)
231 return nullptr;
232
233 QIFStream stream = MakeStreamFromMemory(data, size);
234
235 if (ext && !stricmp(ext, ".wav"))
236 return WaveLoadMemoryStream(stream);
237 if (ext && !stricmp(ext, ".ogg"))
238 {
239 auto* ret = new WaveStreamOGG(stream);
240 if (ret->GetError())
241 {
242 delete ret;
243 return nullptr;
244 }
245 return ret;
246 }
247 return WSSLoadMemoryStream(stream);
248}
249
250} // namespace Poseidon

Callers 4

LLVMFuzzerTestOneInputFunction · 0.85
LLVMFuzzerTestOneInputFunction · 0.85
CreateWaveFromMemoryMethod · 0.85

Calls 5

MakeStreamFromMemoryFunction · 0.85
WaveLoadMemoryStreamFunction · 0.85
WSSLoadMemoryStreamFunction · 0.85
stricmpFunction · 0.50
GetErrorMethod · 0.45

Tested by

no test coverage detected