If you can prove that the search was illegal, or that the police planted the drugs on you, the charges against you will be dismissed. A threat of violence, faking evidence, or neglecting to follow proper procedures could all be considered evidence of corruption.