aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-01-02 14:57:49 +0000
committerAlyssa Milburn2011-01-02 14:57:49 +0000
commit7e0744aa4aa1e7128a1ea95d74db040ceb22a3a0 (patch)
tree149cb1cd1c7c783309699fd18f9b813f1f812610
parent940e4f936eac2aecb6b422e3809082835be4e4e9 (diff)
downloadscummvm-rg350-7e0744aa4aa1e7128a1ea95d74db040ceb22a3a0.tar.gz
scummvm-rg350-7e0744aa4aa1e7128a1ea95d74db040ceb22a3a0.tar.bz2
scummvm-rg350-7e0744aa4aa1e7128a1ea95d74db040ceb22a3a0.zip
VIDEO: Stop leaking surface data in several codecs.
svn-id: r55095
-rw-r--r--graphics/video/codecs/cdtoons.cpp1
-rw-r--r--graphics/video/codecs/indeo3.cpp1
-rw-r--r--graphics/video/codecs/qtrle.cpp1
-rw-r--r--graphics/video/codecs/rpza.cpp5
-rw-r--r--graphics/video/codecs/rpza.h2
-rw-r--r--graphics/video/codecs/smc.cpp5
-rw-r--r--graphics/video/codecs/smc.h2
7 files changed, 15 insertions, 2 deletions
diff --git a/graphics/video/codecs/cdtoons.cpp b/graphics/video/codecs/cdtoons.cpp
index 8cd38b1744..c3d00d8702 100644
--- a/graphics/video/codecs/cdtoons.cpp
+++ b/graphics/video/codecs/cdtoons.cpp
@@ -62,6 +62,7 @@ CDToonsDecoder::CDToonsDecoder(uint16 width, uint16 height) {
}
CDToonsDecoder::~CDToonsDecoder() {
+ _surface->free();
delete _surface;
for (Common::HashMap<uint16, CDToonsBlock>::iterator i = _blocks.begin(); i != _blocks.end(); i++)
diff --git a/graphics/video/codecs/indeo3.cpp b/graphics/video/codecs/indeo3.cpp
index 51e946a75b..a19764dc11 100644
--- a/graphics/video/codecs/indeo3.cpp
+++ b/graphics/video/codecs/indeo3.cpp
@@ -58,6 +58,7 @@ Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height) : _ModPred(0), _correc
}
Indeo3Decoder::~Indeo3Decoder() {
+ _surface->free();
delete _surface;
delete[] _iv_frame[0].the_buf;
diff --git a/graphics/video/codecs/qtrle.cpp b/graphics/video/codecs/qtrle.cpp
index e73d193896..380b89903c 100644
--- a/graphics/video/codecs/qtrle.cpp
+++ b/graphics/video/codecs/qtrle.cpp
@@ -415,6 +415,7 @@ const Surface *QTRLEDecoder::decodeImage(Common::SeekableReadStream *stream) {
QTRLEDecoder::~QTRLEDecoder() {
_surface->free();
+ delete _surface;
}
} // End of namespace Graphics
diff --git a/graphics/video/codecs/rpza.cpp b/graphics/video/codecs/rpza.cpp
index 7212aba64c..6869eaca7d 100644
--- a/graphics/video/codecs/rpza.cpp
+++ b/graphics/video/codecs/rpza.cpp
@@ -47,6 +47,11 @@ RPZADecoder::RPZADecoder(uint16 width, uint16 height) : Codec() {
_surface->create(width, height, _pixelFormat.bytesPerPixel);
}
+RPZADecoder::~RPZADecoder() {
+ _surface->free();
+ delete _surface;
+}
+
#define ADVANCE_BLOCK() \
pixelPtr += 4; \
if (pixelPtr >= _surface->w) { \
diff --git a/graphics/video/codecs/rpza.h b/graphics/video/codecs/rpza.h
index 7a5f2033eb..8be9088bc3 100644
--- a/graphics/video/codecs/rpza.h
+++ b/graphics/video/codecs/rpza.h
@@ -34,7 +34,7 @@ namespace Graphics {
class RPZADecoder : public Codec {
public:
RPZADecoder(uint16 width, uint16 height);
- ~RPZADecoder() { delete _surface; }
+ ~RPZADecoder();
const Surface *decodeImage(Common::SeekableReadStream *stream);
PixelFormat getPixelFormat() const { return _pixelFormat; }
diff --git a/graphics/video/codecs/smc.cpp b/graphics/video/codecs/smc.cpp
index 2f75f5f21e..1b92d3bf85 100644
--- a/graphics/video/codecs/smc.cpp
+++ b/graphics/video/codecs/smc.cpp
@@ -52,6 +52,11 @@ SMCDecoder::SMCDecoder(uint16 width, uint16 height) {
_surface->create(width, height, 1);
}
+SMCDecoder::~SMCDecoder() {
+ _surface->free();
+ delete _surface;
+}
+
const Graphics::Surface *SMCDecoder::decodeImage(Common::SeekableReadStream *stream) {
byte *pixels = (byte *)_surface->pixels;
diff --git a/graphics/video/codecs/smc.h b/graphics/video/codecs/smc.h
index c2ade00141..158cffbce8 100644
--- a/graphics/video/codecs/smc.h
+++ b/graphics/video/codecs/smc.h
@@ -40,7 +40,7 @@ enum {
class SMCDecoder : public Codec {
public:
SMCDecoder(uint16 width, uint16 height);
- ~SMCDecoder() { delete _surface; }
+ ~SMCDecoder();
const Surface *decodeImage(Common::SeekableReadStream *stream);
PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); }