Judge Thokozile Masipa ordered an investigation into the leak after broadcaster eNCA showed a photo of Pistorius' neighbour Michelle Burger during the audio broadcast of her second day of testimony.
While the trial is being televised live, a previous court order had ruled witnesses must give their consent to be filmed.
Television station eNCA on Tuesday accompanied the audio broadcast with a picture of Burger. After prosecutor Gerrie Nel pointed out the leak, Masipa called for a brief adjournment.
Masipa also restricted the media from publishing photos of witnesses who have not consented to be filmed.
Patrick Conroy, the head of news at eNCA, said on Twitter the station had used a photo from the website of the University of Pretoria, where Burger is a lecturer of construction economics. Other newspapers also used the picture, he said.
A separate South African court ruled last month that the trial should be televised, saying it was vital for impoverished South Africans who feel ill-treated by the justice system to get a first-hand look at the proceedings.
"I am warning the media, if you do not behave, you are not going to be treated with soft gloves by this court," Masipa, herself a former journalist, said when the court resumed.
Olympic and Paralympic star Pistorius is on trial for murdering his girlfriend, model Reeva Steenkamp, at his suburban Pretoria home on Valentine's Day last year. He says he mistook her for an intruder.
The trial, which could see one of global sports' most admired figures jailed for life, has drawn comparisons with the high-profile murder trial of American football star and actor O.J. Simpson two decades ago.
Burger, a university lecturer who testified on Monday that she heard "bloodcurdling" screams from a woman followed by gun shots, has not consented to being filmed and only the audio of her testimony is being broadcast.
Burger broke down in tears toward the end of her testimony, following an angry exchange with lead defence attorney Barry Roux, who had sought to show she had mistaken the screams of agitated Pistorius for that of a woman.
Pistorius himself appeared emotional when the court heard details of the bullets hitting Steenkamp and the removal of bullet fragments from her head during the post mortem.
He leaned forward, burying his head in his hands and later appeared to wipe tears away from his eyes. Unlike his bail hearing last year, the track star has been relatively composed during the trial.
The court also heard from a second witness, neighbour Estelle van der Merwe, who testified that she heard what sounded like an argument early on the morning Steenkamp was killed.
"From where I was sitting it seemed like two people were having an argument but I couldn't hear the other person's voice," she said through an Afrikaans language interpreter.
- Crime & Justice
- Society & Culture
- Reeva Steenkamp