SLUDGE: movie: Allocate substream on heap

MKVDecoder takes ownership of the passed stream, it can't be allocated
on the stack. This fixes a crash in MKVDecoder destructor.
This commit is contained in:
Sebastian Krzyszkowiak 2023-07-20 20:40:32 +02:00 committed by Eugene Sandulenko
parent 238670f3cd
commit 4b15de35f7

View File

@ -50,9 +50,9 @@ int playMovie(int fileNumber) {
Common::SeekableReadStream *stream = g_sludge->_resMan->getData();
Common::SeekableSubReadStream video(stream, stream->pos(), stream->pos() + fsize);
Common::SeekableSubReadStream *video = new Common::SeekableSubReadStream(stream, stream->pos(), stream->pos() + fsize);
if (decoder.loadStream(&video))
if (decoder.loadStream(video))
movieIsPlaying = kMoviePlaying;
decoder.start();