mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-01 23:18:44 +00:00
DREAMWEB: Fix OOM check
This commit is contained in:
parent
f191413b1c
commit
21260b35c6
@ -442,9 +442,9 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) {
|
||||
sample.size, 22050, Audio::FLAG_UNSIGNED);
|
||||
} else {
|
||||
uint8 *buffer = (uint8 *)malloc(_speechData.size());
|
||||
memcpy(buffer, _speechData.begin(), _speechData.size());
|
||||
if (!buffer)
|
||||
error("out of memory: cannot allocate memory for sound(%u bytes)", _speechData.size());
|
||||
memcpy(buffer, _speechData.begin(), _speechData.size());
|
||||
raw = Audio::makeRawStream(
|
||||
buffer,
|
||||
_speechData.size(), 22050, Audio::FLAG_UNSIGNED);
|
||||
|
Loading…
Reference in New Issue
Block a user