Check output buffer size before decoding.