metaContour: fix potential out-of-bounds array accesses

Found from compiler warnings.