avcodec/g2meet: check available space before copying palette