Last December Disney filed a lawsuit against Redbox in an effort to get the company to stop selling digital download codes for Disney films. But as The Hollywood Reporter notes, a California federal judge has rejected the studio’s request for an injunction that would have halted the practice. Instead, the judge called into question Disney’s stringent policies about the codes, accusing the studio of “copyright misuse.”

The case results from Redbox’s lack of an existing business arrangement with Disney. The rental service has distribution deals in place with major studios like Warner Bros., which allow Redbox to purchase physical DVDs and Blu-rays of popular movies that it then offers for rental at its standalone kiosks. Disney has struck no such deal, so Redbox purchases retail copies of the films and rents those discs, instead.

However, Disney is also well-known for bundling digital download codes with its physical retail copies. Those codes let a customer download a digital version using Disney’s Movies Anywhere service. Redbox has been selling the digital download codes from the physical copies it purchases, allowing customers to buy movies like Rogue One or Moana at the fraction of the price. (By way of comparison, Redbox codes are available from between $3.99 to $7.99, whereas the same title might cost $19.99 on iTunes or a comparable service.) That led to Disney’s lawsuit, where it argued “Redbox is selling our digital movie codes in blatant disregard of clear prohibitions against doing so. Their actions violate our contracts and copyrights.”

But in a Tuesday ruling, US District Judge Dean D. Pregerson denied the studio’s request for an injunction, arguing that the warning that “Codes are not for sale or transfer” on the DVD and Blu-ray packaging did not constitute a binding contract. Furthermore, he wrote that the licensing agreements that Disney utilizes on the Movies Anywhere and RedeemDigitalMovie websites improperly forced consumers to give up some of their basic ownership rights.

When consumers are redeeming a code, the sites essentially make them acknowledge that they currently own the physical copy that a given download code was bundled with. However, under copyright law, once customers buy a physical copy they are free to sell it, much as they would a used book. The Disney language legally prevents customers from redeeming their digital code — which they paid for as part of their initial purchase — if they have decided to exercise that right to resell the physical DVD or Blu-ray.

“This improper leveraging of Disney’s copyright in the digital content to restrict secondary transfers of physical copies directly implicates and conflicts with public policy enshrined in the Copyright Act, and constitutes copyright misuse,” Pregerson wrote.

In the months since Disney’s suit, Redbox has filed its own lawsuit against the studio, accusing it of anti-competitive behavior. The company has also filed a motion to dismiss Disney’s case outright, with a hearing scheduled for March 5th.