Check dimension
Check dimension

As reported by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16960 and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16878

MaartenBent/matio,MaartenBent/matio,tbeu/matio,tbeu/matio,tbeu/matio,tbeu/matio,MaartenBent/matio,MaartenBent/matio