libavfilter/scale2ref: Fix out-of-bounds array access