diff --git a/src/streams-jar.cpp b/src/streams-jar.cpp
index 521b1f9a96343726f577af5737a254e7f5ff5180..e597822e9280a426778ec16f0986fa8331d708ff 100644 (file)
--- a/src/streams-jar.cpp
+++ b/src/streams-jar.cpp
+#include <vector>
#include "streams-jar.h"
namespace Inkscape {
#include "streams-jar.h"
namespace Inkscape {
int ret=do_consume_and_inflate(nbytes);
if ( ret == EOF && eflen > 0 ) {
int ret=do_consume_and_inflate(nbytes);
if ( ret == EOF && eflen > 0 ) {
- guint8 *efbuf=new guint8[eflen];
- _urihandle->read(efbuf, eflen);
- delete [] efbuf;
+ std::vector<guint8> efbuf(eflen);
+ _urihandle->read(&efbuf[0], eflen);
return 1;
}
return 1;
}
int JarBuffer::consume_uncompressed(int nbytes)
{
int JarBuffer::consume_uncompressed(int nbytes)
{
- guint8 *data=new guint8[nbytes];
- int consumed=consume(data, nbytes);
+ std::vector<guint8> data(nbytes);
+ int consumed=consume(&data[0], nbytes);
if ( consumed != EOF ) {
if ( consumed != EOF ) {
- copy_to_get(data, consumed);
+ copy_to_get(&data[0], consumed);
compressed_left -= consumed;
}
compressed_left -= consumed;
}
- delete [] data;
return consumed;
}
return consumed;
}