Add required header mem.h, av_malloc and friends are used.