diff options
Diffstat (limited to 'sound/decoders')
-rw-r--r-- | sound/decoders/aiff.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/decoders/aiff.cpp b/sound/decoders/aiff.cpp index b76410f8d1..ce8c6ad32c 100644 --- a/sound/decoders/aiff.cpp +++ b/sound/decoders/aiff.cpp @@ -175,7 +175,9 @@ SeekableAudioStream *makeAIFFStream(Common::SeekableReadStream *stream, data = (byte *)malloc(size); assert(data); stream->read(data, size); - delete stream; + + if (disposeAfterUse == DisposeAfterUse::YES) + delete stream; // Since we allocated our own buffer for the data, we must specify DisposeAfterUse::YES. return makeRawStream(data, size, rate, flags); |