[trunk] correct wrong input in dump_codec function and add missing return value