Fix spectrogram loading error found by cppcheck

Refs #9970
Merge branch 'feature/9970_refactor_project_serialisation' into develop