mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-25 20:32:33 +00:00
Removed the z_streams and bz_streams as member variables because they are initialized in each call to compress()/decompress().
This commit is contained in:
parent
5892b628ae
commit
dbd36858fd
@ -88,6 +88,7 @@ unsigned char *zlib_compression_c::decompress(unsigned char *buffer,
|
|||||||
int &size) {
|
int &size) {
|
||||||
unsigned char *dst;
|
unsigned char *dst;
|
||||||
int result, dstsize;
|
int result, dstsize;
|
||||||
|
z_stream d_stream;
|
||||||
|
|
||||||
dst = (unsigned char *)safemalloc(size * 20);
|
dst = (unsigned char *)safemalloc(size * 20);
|
||||||
|
|
||||||
@ -122,10 +123,13 @@ unsigned char *zlib_compression_c::decompress(unsigned char *buffer,
|
|||||||
unsigned char *zlib_compression_c::compress(unsigned char *buffer, int &size) {
|
unsigned char *zlib_compression_c::compress(unsigned char *buffer, int &size) {
|
||||||
unsigned char *dst;
|
unsigned char *dst;
|
||||||
int result, dstsize;
|
int result, dstsize;
|
||||||
|
z_stream c_stream;
|
||||||
|
|
||||||
dst = (unsigned char *)safemalloc(size * 2);
|
dst = (unsigned char *)safemalloc(size * 2);
|
||||||
|
|
||||||
memset(&c_stream, 0, sizeof(c_stream));
|
c_stream.zalloc = (alloc_func)0;
|
||||||
|
c_stream.zfree = (free_func)0;
|
||||||
|
c_stream.opaque = (voidpf)0;
|
||||||
result = deflateInit(&c_stream, 9);
|
result = deflateInit(&c_stream, 9);
|
||||||
if (result != Z_OK)
|
if (result != Z_OK)
|
||||||
mxerror("deflateInit() failed. Result: %d\n", result);
|
mxerror("deflateInit() failed. Result: %d\n", result);
|
||||||
@ -168,6 +172,7 @@ bzlib_compression_c::~bzlib_compression_c() {
|
|||||||
unsigned char *bzlib_compression_c::decompress(unsigned char *buffer,
|
unsigned char *bzlib_compression_c::decompress(unsigned char *buffer,
|
||||||
int &size) {
|
int &size) {
|
||||||
int result;
|
int result;
|
||||||
|
bz_stream d_stream;
|
||||||
|
|
||||||
die("bzlib_compression_c::decompress() not implemented\n");
|
die("bzlib_compression_c::decompress() not implemented\n");
|
||||||
|
|
||||||
@ -187,6 +192,7 @@ unsigned char *bzlib_compression_c::compress(unsigned char *buffer,
|
|||||||
int &size) {
|
int &size) {
|
||||||
unsigned char *dst;
|
unsigned char *dst;
|
||||||
int result, dstsize;
|
int result, dstsize;
|
||||||
|
bz_stream c_stream;
|
||||||
|
|
||||||
dst = (unsigned char *)safemalloc(size * 2);
|
dst = (unsigned char *)safemalloc(size * 2);
|
||||||
|
|
||||||
|
@ -81,9 +81,6 @@ public:
|
|||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
class zlib_compression_c: public compression_c {
|
class zlib_compression_c: public compression_c {
|
||||||
protected:
|
|
||||||
z_stream c_stream, d_stream;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
zlib_compression_c();
|
zlib_compression_c();
|
||||||
virtual ~zlib_compression_c();
|
virtual ~zlib_compression_c();
|
||||||
@ -97,9 +94,6 @@ public:
|
|||||||
#include <bzlib.h>
|
#include <bzlib.h>
|
||||||
|
|
||||||
class bzlib_compression_c: public compression_c {
|
class bzlib_compression_c: public compression_c {
|
||||||
protected:
|
|
||||||
bz_stream c_stream, d_stream;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bzlib_compression_c();
|
bzlib_compression_c();
|
||||||
virtual ~bzlib_compression_c();
|
virtual ~bzlib_compression_c();
|
||||||
|
Loading…
Reference in New Issue
Block a user