Indeed, I suppose this could mean either, although my immediate understanding is that the portrait depicts her, not that it was painted by her. If you want to be dead positive that the portrait depicts her, I expect you could say "a portrait of her" although this is... errrm, less elegant
PS. And just to make things even tougher, in certain contexts her portrait could probably be interpreted to mean a portrait of someone else that belongs to her.
You can say: We hung a portrait by her above the fireplace. (she is the artist)
We hung a portrait of her above the fireplace. (she is the one portrayed)
We hung a portrait of hers above the fireplace. (she is the owner)
.. but more often we might use a circumlocution.