Plug bad mem leak if using libavcodec 54.35 (libav9) or above