ismindex: improve diagnostics

This improves error messages for completely and somewhat broken inputs.

Signed-off-by: Martin Storsjö <martin@martin.st>
Merge commit 'e48d1ea541be4592ebac89875557407ca958b7a9'

* commit 'e48d1ea541be4592ebac89875557407ca958b7a9':
  ismindex: improve diagnostics

Conflicts:
	tools/ismindex.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
segment: don't access outside seg->frames array

Fixes wrong number of segments output and undefined memory access.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>