summaryrefslogtreecommitdiff
path: root/lib/bitio.c
diff options
context:
space:
mode:
authorkramm <kramm>2004-04-07 10:08:03 +0000
committerkramm <kramm>2004-04-07 10:08:03 +0000
commitd8350b2fe736ab38ac980183a003a2dc88e46efa (patch)
tree75f834aace3344053f6a4cf91bcebe5b51cc12a0 /lib/bitio.c
parent385fb1fd5f980b87e69770a720e1ce255c9f7b2a (diff)
zlib writer no longer calls finish() on it's output writer
Diffstat (limited to 'lib/bitio.c')
-rw-r--r--lib/bitio.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bitio.c b/lib/bitio.c
index 2394121e..923430a1 100644
--- a/lib/bitio.c
+++ b/lib/bitio.c
@@ -303,6 +303,10 @@ static int writer_zlibdeflate_write(struct writer_t*writer, void* data, int len)
#ifdef HAVE_ZLIB
struct zlibdeflate_t*z = (struct zlibdeflate_t*)writer->internal;
int ret;
+ if(writer->type != WRITER_TYPE_ZLIB) {
+ fprintf(stderr, "Wrong writer ID (writer not initialized?)\n");
+ return 0;
+ }
if(!z) {
fprintf(stderr, "zlib not initialized!\n");
return 0;
@@ -341,6 +345,10 @@ static void writer_zlibdeflate_finish(struct writer_t*writer)
struct zlibdeflate_t*z = (struct zlibdeflate_t*)writer->internal;
struct writer_t*output;
int ret;
+ if(writer->type != WRITER_TYPE_ZLIB) {
+ fprintf(stderr, "Wrong writer ID (writer not initialized?)\n");
+ return;
+ }
if(!z)
return;
output= z->output;
@@ -364,7 +372,7 @@ static void writer_zlibdeflate_finish(struct writer_t*writer)
if (ret != Z_OK) zlib_error(ret, "bitio:deflate_end", &z->zs);
free(writer->internal);
writer->internal = 0;
- output->finish(output);
+ //output->finish(output);
#else
fprintf(stderr, "Error: swftools was compiled without zlib support");
exit(1);