From 2e015ff3839908c804ce2f26d0589a0dd1148a5f Mon Sep 17 00:00:00 2001 From: Mathis Rosenhauer Date: Tue, 20 Nov 2012 17:26:43 +0100 Subject: [PATCH] Check output availability --- src/encode.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/encode.c b/src/encode.c index cc7eae1..612d33a 100644 --- a/src/encode.c +++ b/src/encode.c @@ -605,11 +605,12 @@ static int m_get_rsi_resumable(struct aec_stream *strm) } emit(state, 0, state->bits); - if (state->direct_out == 0) - *strm->next_out++ = *state->cds; - strm->avail_out--; - strm->total_out++; - + if (strm->avail_out > 0) { + if (state->direct_out == 0) + *strm->next_out++ = *state->cds; + strm->avail_out--; + strm->total_out++; + } return M_EXIT; } } else { -- 2.7.4