Set uncomp_len and ref during init. Important for no PP.
authorMathis Rosenhauer <rosenhauer@dkrz.de>
Tue, 5 Aug 2014 13:48:14 +0000 (15:48 +0200)
committerMathis Rosenhauer <rosenhauer@dkrz.de>
Wed, 6 Aug 2014 11:39:08 +0000 (13:39 +0200)
src/decode.c
src/encode.c

index f636c3a..36fc6b2 100644 (file)
@@ -651,6 +651,7 @@ int aec_decode_init(struct aec_stream *strm)
     state = malloc(sizeof(struct internal_state));
     if (state == NULL)
         return AEC_MEM_ERROR;
+    memset(state, 0, sizeof(struct internal_state));
 
     create_se_table(state->se_table);
 
@@ -729,6 +730,7 @@ int aec_decode_init(struct aec_stream *strm)
     if (state->rsi_buffer == NULL)
         return AEC_MEM_ERROR;
 
+    state->ref = 0;
     strm->total_in = 0;
     strm->total_out = 0;
 
index 8046326..98d67d7 100644 (file)
@@ -793,6 +793,7 @@ int aec_encode_init(struct aec_stream *strm)
 
     memset(state, 0, sizeof(struct internal_state));
     strm->state = state;
+    state->uncomp_len = strm->block_size * strm->bits_per_sample;
 
     if (strm->bits_per_sample > 16) {
         /* 24/32 input bit settings */
@@ -886,6 +887,7 @@ int aec_encode_init(struct aec_stream *strm)
 
     state->block = state->data_pp;
 
+    state->ref = 0;
     strm->total_in = 0;
     strm->total_out = 0;
     state->flushed = 0;