bitstream: fix a crash in case of oom