No need to increment the buffer chunk by chunk when we know the full size.
vlc_memstream also adds an extra \0 after each call for nothing.