From: Fridrich S. <str...@us...> - 2008-07-23 14:42:22
|
Update of /cvsroot/libwpg/libwpg/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24872/src/lib Modified Files: Tag: STABLE-0-1-0 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.58.2.12 retrieving revision 1.58.2.13 diff -u -d -r1.58.2.12 -r1.58.2.13 --- WPG2Parser.cpp 23 Jul 2008 09:54:17 -0000 1.58.2.12 +++ WPG2Parser.cpp 23 Jul 2008 14:42:16 -0000 1.58.2.13 @@ -1591,6 +1591,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.11.2.6 retrieving revision 1.11.2.7 diff -u -d -r1.11.2.6 -r1.11.2.7 --- WPGBitmap.cpp 18 Jul 2008 13:12:17 -0000 1.11.2.6 +++ WPGBitmap.cpp 23 Jul 2008 14:42:16 -0000 1.11.2.7 @@ -63,8 +63,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)) |