Update of /cvsroot/libwpg/libwpg/src/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24920/src/lib
Modified Files:
WPG2Parser.cpp WPGBitmap.cpp
Log Message:
handle in the new std::vector-based RL decoding a broken bitmap the same way as the preallocated-buffer method was
Index: WPG2Parser.cpp
===================================================================
RCS file: /cvsroot/libwpg/libwpg/src/lib/WPG2Parser.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- WPG2Parser.cpp 23 Jul 2008 09:53:55 -0000 1.77
+++ WPG2Parser.cpp 23 Jul 2008 14:42:47 -0000 1.78
@@ -1581,6 +1581,9 @@
// no buffer? format is unknown
if(!buffer.size()) return;
+
+ for ( ; buffer.size() < tmpBufferSize; )
+ buffer.push_back(0);
// prepare the bitmap structure for the listener
libwpg::WPGBitmap bitmap(width, height, m_vFlipped, m_hFlipped);
Index: WPGBitmap.cpp
===================================================================
RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGBitmap.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- WPGBitmap.cpp 18 Jul 2008 13:11:57 -0000 1.20
+++ WPGBitmap.cpp 23 Jul 2008 14:42:47 -0000 1.21
@@ -62,8 +62,12 @@
libwpg::WPGBitmap::~WPGBitmap()
{
- delete [] d->pixels;
- delete d;
+ if (d)
+ {
+ if (d->pixels)
+ delete [] d->pixels;
+ delete d;
+ }
}
libwpg::WPGBitmap::WPGBitmap(const WPGBitmap& bitmap): rect(), d(new Private(0,0))
|