X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fstreams-zlib.cpp;h=9e139e3016c31e41272eaa7d1e0e36683da1711e;hb=c51988f347a9a11ea597fee3d5f56a42f4c0dd7b;hp=5784a17cf44683e098a6847c9acc096a3b20b0a3;hpb=47d32690b154bab52ddbb67c744d8d5704638f89;p=inkscape.git diff --git a/src/streams-zlib.cpp b/src/streams-zlib.cpp index 5784a17cf..9e139e301 100644 --- a/src/streams-zlib.cpp +++ b/src/streams-zlib.cpp @@ -9,6 +9,7 @@ * Released under GNU LGPL, read the file 'COPYING.LIB' for more information */ +#include #include "streams-zlib.h" namespace Inkscape { @@ -104,18 +105,17 @@ int ZlibBuffer::do_consume(guint8 *buf, int nbytes) int ZlibBuffer::do_consume_and_inflate(int nbytes) { - guint8 *buf=new guint8[nbytes]; + std::vector buf(nbytes); - int ret=consume(buf, nbytes); + int ret=consume(&buf[0], nbytes); if ( ret != EOF ) { ret = 1; - GByteArray *gba = inflate(buf, nbytes); + GByteArray *gba = inflate(&buf[0], nbytes); copy_to_get(gba->data, gba->len); g_byte_array_free(gba, TRUE); } - delete [] buf; return ret; }