a2m.cpp: Fix summation of data block lengths
a2m.cpp: Fix summation of data block lengths

Due to integer division with wrong rounding, one extra element
of len would be added to the sum when numpats was a multiple
of 8 (version >= 5) or 16. That was mostly benign, but for a
version >= 5 file with 64 patterns that would read past the
end of the len array. Fix the computation and simplify block
handling by introducing a variable holding the number of blocks.

While at it, simplify block decoding substantially by converting
the unrolled mess to a loop, fixing the misleading formatting
(or missin braces) along the way.

Also check that there is at least one pattern in the file.

This commit fixes an OOB read for fuzzing sample i-110_129.a2m.

Bug: https://github.com/adplug/adplug/issues/110

adplug/adplug,adplug/adplug