One way to prevent attack is to not read from the stream until the decoder can process the stream immediately. This approach creates a deadlock hazard and is examined in this article.
Compression schemes that allow head-of-line blocking are targets for memory exhaustion attacks against the decoder. One way to avoid an attack is presented.
Head-of-line blocking causes priority inversion and vice versa. Learn more.