sgidec: Use bytestream2 functions to prevent buffer overreads.