A DRUG addict who left three young children in "extreme danger" near a railway track while she bought heroin has been sent to jail.

Lisa Smith used a pedestrian crossing to go over the track in Malvern with the children she was looking after on May 4 this year, then went through a safety gate and left them alone for five minutes while she bought the drugs in an alley, Worcester Crown Court was told.

A passerby saw the children at the foot of an embankment with the tracks above them and took a few seconds of footage on his mobile phone, which was shown to the court.

A train could be seen speeding past, sounding its horn, along the top of the bank a few feet above where two of them were standing. One of them appeared to be holding the younger one so that he wasn't frightened, Adam Western, prosecuting, told the court.

She was seen at about 4.15pm near Jamaica Road and Goodwood Road and the passerby who feared the children were in danger took the film then transferred it to DVD and handed it in to police.

Smith, 26, of Sherrards Green Road, Malvern, admitted she had been buying heroin but said she had been watching the children and felt they were safe. She pleaded guilty to two charges in connection with the incident.

Kevin Batch, defending, said Smith had signed up for a detox programme due to start shortly and had been getting help to tackle her heroin addiction.

Judge Nicolas Cartwright said the video was "terrifying" and two of the three children had been exposed to "extreme danger." They could have suffered life changing or even fatal injuries, he said.

"You crossed over to meet a drug dealer to buy heroin. That was your priority," he said to Smith.

There was a fence and a swing gate at the pedestrian crossing and warning signs nearby, he said. The children had been left at the foot of a slope leading up to the railway tracks where a train had gone by at considerable speed and one of the boys had held the other.

"He had seen the danger you were oblivious to, that the small boy might be taken under the steel wheels of the train," he told Smith.

"You were fifteen metres away from them on the other side of a safety fence which would have prevented you from getting to them quickly. You weren't really paying attention to them as you were more concerned with getting heroin."

Smith was given three months on each charge to run consecutively, a total of six months.