Fix spectrogram loading error found by cppcheck

Refs #9970