I had a batch of brined whole vegetables infected with fruit flies earlier this year. A few years back, a young batch of sourdough starter got similarly infected. I have a few thoughts:
First, I think that the eggs and larvae are a surface phenomenon. The eggs would have been deposited at the surface, and it appeared to me that the larvae were operating right along the top of the batch. So it's entirely possible that you could scoop out the larvae and things would be fine.
However, as a second point, I'd note that my sourdough starter had clear mold colonies starting where fruit flies had become entrapped. So there's a danger that in their travels, they may have encountered bacteria that could make your batch toxic. I don't know enough about the pH and inhibitory qualities of fermenting organisms to speak to that, but the concern is great enough that, like Jay, I'd just toss it.
If you're deeply committed and the fly infestation is new, I guess you could try removing the larvae, draining the vessel, rinsing the pickles thoroughly, then putting them in a fresh vessel with new brine.
Good luck. If you try to salvage it, let us know how it turns out.
--
Stacie Boschma
Po. Et.
404-259-1717
"I have had the wind knocked out of me, but never the hurricane." Jeffrey McDaniel