You can criticize another's meaning of life as being meaningless to you, but you can't say that it is absolutely meaningless, as it is obviously meaningful to the masochist. One's meaning of life should have value to you, not necessarily to anyone else. I would say that what drives all forms of life is the urge to stay alive and procreate. Because avoiding pain is part and parcel of staying alive, then hedonism is indeed a result of the life drive. But the ultimate drive, the objective meaning of life, is to live.
Hedonism is simply a byproduct of the prime directive, so to speak.
It's merely the avidance of pain, which many organisms do without seeking pleasure. So masochism does not necessarily violate the main drive, the objective meaning of life, wich is to live. True, the masochist does not avoid pain, but the avoidance of pain is not necessary, only the drive to live. Cut yourself as much as you want, it doesn't violate the desire to live unless you intend to kill yourself.