Use av_malloc/free instead of new in the hope that the buffer is aligned.