[Scummvm-git-logs] scummvm master -> 4b15de35f7999efdd5ebe1f44ad3d7e30bcd08d3

sev- noreply at scummvm.org
Sat Jul 22 10:51:24 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4b15de35f7 SLUDGE: movie: Allocate substream on heap


Commit: 4b15de35f7999efdd5ebe1f44ad3d7e30bcd08d3
    https://github.com/scummvm/scummvm/commit/4b15de35f7999efdd5ebe1f44ad3d7e30bcd08d3
Author: Sebastian Krzyszkowiak (dos at dosowisko.net)
Date: 2023-07-22T12:51:21+02:00

Commit Message:
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.

Changed paths:
    engines/sludge/movie.cpp


diff --git a/engines/sludge/movie.cpp b/engines/sludge/movie.cpp
index 87100d99678..c7c2e03d7a0 100644
--- a/engines/sludge/movie.cpp
+++ b/engines/sludge/movie.cpp
@@ -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();




More information about the Scummvm-git-logs mailing list