avfilter/vf_lagfun: fix heap-buffer overflow