diff options
author | Mathis Rosenhauer <rosenhauer@dkrz.de> | 2012-11-20 17:26:43 +0100 |
---|---|---|
committer | Thomas Jahns <jahns@dkrz.de> | 2013-02-19 11:33:00 +0100 |
commit | 2e015ff3839908c804ce2f26d0589a0dd1148a5f (patch) | |
tree | 573e09bd04614a0d248885eea90be182569cfa10 /src/encode.c | |
parent | 3d5b023dedf57b4c447a0a8c89c4057bb67a3ac0 (diff) | |
download | libaec-2e015ff3839908c804ce2f26d0589a0dd1148a5f.tar.gz libaec-2e015ff3839908c804ce2f26d0589a0dd1148a5f.tar.bz2 libaec-2e015ff3839908c804ce2f26d0589a0dd1148a5f.zip |
Check output availability
Diffstat (limited to 'src/encode.c')
-rw-r--r-- | src/encode.c | 11 |
1 files 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 { |