aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorrichiesams2013-09-03 18:18:16 -0500
committerMatthew Hoops2013-09-03 19:24:41 -0400
commit9b027771557bf308d8aa92ea9c25b30be15b68d6 (patch)
treeef938632cd2d887acfd49cb1ede93e2da5c22eb8 /video
parentf6b61291a75697500d950c1ea55cdbf502d08372 (diff)
downloadscummvm-rg350-9b027771557bf308d8aa92ea9c25b30be15b68d6.tar.gz
scummvm-rg350-9b027771557bf308d8aa92ea9c25b30be15b68d6.tar.bz2
scummvm-rg350-9b027771557bf308d8aa92ea9c25b30be15b68d6.zip
VIDEO: Fix memory leak in TrueMotion1 header buffer
Cleanup _buf before returning, even if we don't actually decode
Diffstat (limited to 'video')
-rw-r--r--video/codecs/truemotion1.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/codecs/truemotion1.cpp b/video/codecs/truemotion1.cpp
index e475c8426c..720e86a4ff 100644
--- a/video/codecs/truemotion1.cpp
+++ b/video/codecs/truemotion1.cpp
@@ -400,11 +400,14 @@ void TrueMotion1Decoder::decode16() {
const Graphics::Surface *TrueMotion1Decoder::decodeImage(Common::SeekableReadStream *stream) {
decodeHeader(stream);
- if (compressionTypes[_header.compression].algorithm == ALGO_NOP)
+ if (compressionTypes[_header.compression].algorithm == ALGO_NOP) {
+ delete[] _buf;
return 0;
+ }
if (compressionTypes[_header.compression].algorithm == ALGO_RGB24H) {
warning("Unhandled TrueMotion1 24bpp frame");
+ delete[] _buf;
return 0;
} else
decode16();