From 15c041d84746c859e04d90503881c9ef90123c44 Mon Sep 17 00:00:00 2001 From: Mathis Rosenhauer Date: Tue, 5 Aug 2014 15:48:14 +0200 Subject: [PATCH] Set uncomp_len and ref during init. Important for no PP. --- src/decode.c | 2 ++ src/encode.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/decode.c b/src/decode.c index f636c3a..36fc6b2 100644 --- a/src/decode.c +++ b/src/decode.c @@ -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; diff --git a/src/encode.c b/src/encode.c index 8046326..98d67d7 100644 --- a/src/encode.c +++ b/src/encode.c @@ -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; -- 2.7.4