aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorColin Snover2016-10-09 11:32:01 -0500
committerColin Snover2016-10-09 11:32:01 -0500
commit832979c2db8d42160887299ffe3d4666f1a7d445 (patch)
tree7955e6d588e7be41d25136f4a3687f03454dde56 /engines/sci/engine
parent40444b0aeb11da5ccde497866bffdc80e18392b8 (diff)
downloadscummvm-rg350-832979c2db8d42160887299ffe3d4666f1a7d445.tar.gz
scummvm-rg350-832979c2db8d42160887299ffe3d4666f1a7d445.tar.bz2
scummvm-rg350-832979c2db8d42160887299ffe3d4666f1a7d445.zip
SCI: Fix memory leak
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kvideo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp
index ab216c51cf..83a02883af 100644
--- a/engines/sci/engine/kvideo.cpp
+++ b/engines/sci/engine/kvideo.cpp
@@ -165,7 +165,6 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) {
switch (argv[0].toUint16()) {
case 0: {
Common::String filename = s->_segMan->getString(argv[1]);
- videoDecoder = new Video::AVIDecoder();
if (filename.equalsIgnoreCase("gk2a.avi")) {
// HACK: Switch to 16bpp graphics for Indeo3.
@@ -180,6 +179,8 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) {
}
}
+ videoDecoder = new Video::AVIDecoder();
+
if (!videoDecoder->loadFile(filename.c_str())) {
warning("Failed to open movie file %s", filename.c_str());
delete videoDecoder;