avcodec/mlz: Check output chars before using it