Commit 0604e04b authored by Mathis Rosenhauer's avatar Mathis Rosenhauer Committed by Thomas Jahns
Browse files

Fix zero block bug

parent fef349b5
...@@ -195,11 +195,11 @@ static int m_get_block(struct aec_stream *strm) ...@@ -195,11 +195,11 @@ static int m_get_block(struct aec_stream *strm)
if (state->blocks_avail == 0) { if (state->blocks_avail == 0) {
state->ref = 1; state->ref = 1;
state->blocks_avail = strm->rsi - 1;
state->block_p = state->block_buf; state->block_p = state->block_buf;
if (strm->avail_in >= state->block_len * strm->rsi) { if (strm->avail_in >= state->block_len * strm->rsi) {
state->get_block(strm); state->get_block(strm);
state->blocks_avail = strm->rsi - 1;
if (strm->flags & AEC_DATA_PREPROCESS) if (strm->flags & AEC_DATA_PREPROCESS)
state->preprocess(strm); state->preprocess(strm);
...@@ -258,6 +258,7 @@ static int m_get_block_cautious(struct aec_stream *strm) ...@@ -258,6 +258,7 @@ static int m_get_block_cautious(struct aec_stream *strm)
return input_empty(strm); return input_empty(strm);
} while (++state->i < strm->rsi * strm->block_size); } while (++state->i < strm->rsi * strm->block_size);
state->blocks_avail = strm->rsi - 1;
if (strm->flags & AEC_DATA_PREPROCESS) if (strm->flags & AEC_DATA_PREPROCESS)
state->preprocess(strm); state->preprocess(strm);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment