aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/agi_v3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/agi_v3.cpp')
-rw-r--r--engines/agi/agi_v3.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/agi/agi_v3.cpp b/engines/agi/agi_v3.cpp
index c6fb850c60..dc419a7afe 100644
--- a/engines/agi/agi_v3.cpp
+++ b/engines/agi/agi_v3.cpp
@@ -345,7 +345,8 @@ int AgiLoader_v3::loadResource(int t, int n) {
data = loadVolRes(&_vm->_game.dirSound[n]);
if (data != NULL) {
- _vm->_game.sounds[n].rdata = data;
+ // Freeing of the raw resource from memory is delegated to the createFromRawResource-function
+ _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound);
_vm->_game.dirSound[n].flags |= RES_LOADED;
} else {
ec = errBadResource;