summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats/gif
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-16 22:58:16 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-16 22:58:16 (GMT)
commitcae83b15d35c17daebecdc99acf34c55bce1a6c3 (patch)
tree6807c5710563b317b02b6fe17d87f0d5edd22372 /src/plugins/imageformats/gif
parent30c8d1e3dccc83499ac3d76284cfb2e8d860808a (diff)
parentdf3883b1dae79598e7d5f6b470c876de9cfc8bf2 (diff)
downloadQt-cae83b15d35c17daebecdc99acf34c55bce1a6c3.zip
Qt-cae83b15d35c17daebecdc99acf34c55bce1a6c3.tar.gz
Qt-cae83b15d35c17daebecdc99acf34c55bce1a6c3.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: doc: Added more DITA output to the XML generator Defer allocation of GIF decoding tables/stack. Make sure only started gestures can cause cancellations Updated JavaScriptCore from /home/khansen/dev/qtwebkit-qtscript-integration to javascriptcore-snapshot-16062010 ( 8b2d3443afca194f8ac50a63151dc9d19a150582 ) qmake: Fix CONFIG += exceptions_off with the MSVC project generator. Fix some kind of race condition while using remote commands. Work around ICE in Intel C++ Compiler 11.1.072 Reduce the memory consumption of QtFontStyle
Diffstat (limited to 'src/plugins/imageformats/gif')
-rw-r--r--src/plugins/imageformats/gif/qgifhandler.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp
index 591e40b..129a11b 100644
--- a/src/plugins/imageformats/gif/qgifhandler.cpp
+++ b/src/plugins/imageformats/gif/qgifhandler.cpp
@@ -132,8 +132,8 @@ private:
int code_size, clear_code, end_code, max_code_size, max_code;
int firstcode, oldcode, incode;
- short table[2][1<< max_lzw_bits];
- short stack[(1<<(max_lzw_bits))*2];
+ short* table[2];
+ short* stack;
short *sp;
bool needfirst;
int x, y;
@@ -162,6 +162,9 @@ QGIFFormat::QGIFFormat()
lcmap = false;
newFrame = false;
partialNewFrame = false;
+ table[0] = 0;
+ table[1] = 0;
+ stack = 0;
}
/*!
@@ -171,6 +174,7 @@ QGIFFormat::~QGIFFormat()
{
if (globalcmap) delete[] globalcmap;
if (localcmap) delete[] localcmap;
+ delete [] stack;
}
void QGIFFormat::disposePrevious(QImage *image)
@@ -237,6 +241,12 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length,
// CompuServe Incorporated. GIF(sm) is a Service Mark property of
// CompuServe Incorporated."
+ if (!stack) {
+ stack = new short[(1 << max_lzw_bits) * 4];
+ table[0] = &stack[(1 << max_lzw_bits) * 2];
+ table[1] = &stack[(1 << max_lzw_bits) * 3];
+ }
+
image->detach();
int bpl = image->bytesPerLine();
unsigned char *bits = image->bits();