atomicobject / heatshrink

data compression library for embedded/real-time systems
ISC License
1.33k stars 180 forks source link

Use pre-defined DEF_BUFFER_SIZE instead of 4096 #39

Closed cliffbaumann closed 8 years ago

cliffbaumann commented 8 years ago

Ran into an issue when encoding where heatshrink_encoder_poll() returned 1026 bytes in poll_sz even though my DEF_BUFFER_SIZE was set to 1024. This led to handle_size() rejecting the request because size (aka poll_sz) was larger than io->size (aka DEF_BUFFER_SIZE).

cliffbaumann commented 8 years ago

Going to resubmit PR using cfg->buffer_size instead of DEF_BUFFER_SIZE. DEF_BUFFER_SIZE worked for me because I was not changing cfg->buffer_size from DEF_BUFFER_SIZE.