a2m.cpp: Fix checks for input buffer overflow during sixdepak
a2m.cpp: Fix checks for input buffer overflow during sixdepak

In Ca2mLoader::inputcode() and Ca2mLoader::uncompress(),
ibufcount should be compated to input_size, not MAXBUF.
Moreover, the former method had a type and compared the wrong
variable. Divide input_size by two to make it a count of
shorts, not bytes. Check for empty compressed input early.

Wrapping around the input/output buffer counters on overflow
still looks bogus. It would probably better to abort decoding
instead.

This commit fixes crashes for the following fuzzing samples:
  i-110_006.a2m, i-110_010.a2m, i-110_044.a2m, i-110_074.a2m,
  i-110_076.a2m, i-110_108.a2m, i-110_132.a2m, i-110_137.a2m,
  i-110_170.a2m.

i-110_008.a2m loads now, but doesn't finish to play in a
reasonable time frame; i-110_042.a2m and i-110_073.a2m hang
during load instead of crashing.

The following samples now crash in a different place:
  i-110_005.a2m, i-110_007.a2m, i-110_011.a2m, i-110_041.a2m,
  i-110_075.a2m, i-110_077.a2m, i-110_078.a2m, i-110_091.a2m.

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

adplug/adplug,adplug/adplug