Commit aa5a267e authored by Mathis Rosenhauer's avatar Mathis Rosenhauer

Return error code if output buffer is full in aec_buffer_encode().

parent 36c5013f
......@@ -932,8 +932,8 @@ int aec_buffer_encode(struct aec_stream *strm)
if (status != AEC_OK)
return status;
status = aec_encode(strm, AEC_FLUSH);
if (strm->avail_in > 0)
status = AEC_DATA_ERROR;
if (strm->avail_out == 0)
status = AEC_STREAM_ERROR;
aec_encode_end(strm);
return status;
......
......@@ -170,18 +170,14 @@ int SZ_BufftoBuffCompress(void *dest, size_t *destLen,
}
status = aec_buffer_encode(&strm);
if (status != AEC_OK)
return status;
*destLen = strm.total_out;
if (pad_scanline && padbuf)
free(padbuf);
if (interleave && buf)
free(buf);
return SZ_OK;
return status;
}
int SZ_BufftoBuffDecompress(void *dest, size_t *destLen,
......
......@@ -15,7 +15,7 @@
#define SZ_NO_ENCODER_ERROR -1
#define SZ_PARAM_ERROR AEC_CONF_ERROR
#define SZ_MEM_ERROR AEC_MEM_ERROR
#define SZ_OUTBUFF_FULL -2
#define SZ_OUTBUFF_FULL AEC_STREAM_ERROR
#define SZ_MAX_PIXELS_PER_BLOCK 32
#define SZ_MAX_BLOCKS_PER_SCANLINE 128
......
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