The relevant legislation would appear to be s91H of the Crimes Act 1900 (NSW).
Here it is (with the most relevant parts in bold):
91H Production, dissemination or possession of child pornography
(1) Definitions
In this section:
child pornography means material that depicts or describes, in a manner that would in all the circumstances cause offence to reasonable persons, a person under (or apparently under) the age of 16 years:
(a) engaged in sexual activity, or
(b) in a sexual context, or
© as the victim of torture, cruelty or physical abuse (whether or not in a sexual context).
disseminate child pornography, includes:
(a) send, supply, exhibit, transmit or communicate it to another person, or
(b) make it available for access by another person, or
© enter into any agreement or arrangement to do so.
(2) Production or dissemination of child pornography
A person who produces or disseminates child pornography is guilty of an offence.
Maximum penalty: imprisonment for 10 years.
(3) Possession of child pornography
A person who has child pornography in his or her possession is guilty of an offence.
Maximum penalty: imprisonment for 5 years.
(4) Defences
It is a defence to any charge for an offence under subsection (2) or (3):
(a) that the defendant did not know, and could not reasonably be expected to have known, that he or she produced, disseminated or possessed (as the case requires) child pornography, or
(b) that the material concerned was classified (whether before or after the commission of the alleged offence) under the Classification (Publications, Films and Computer Games) Act 1995 of the Commonwealth, other than as refused classification (RC), or
© that, having regard to the circumstances in which the material concerned was produced, used or intended to be used, the defendant was acting for a genuine child protection, scientific, medical, legal, artistic or other public benefit purpose and the defendant’s conduct was reasonable for that purpose, or
(d) that the defendant was a law enforcement officer acting in the course of his or her official duties, or
(e) that the defendant was acting in the course of his or her official duties in connection with the classification of the material concerned under the Classification (Publications, Films and Computer Games) Act 1995 of the Commonwealth.
(5) Defence to possession of child pornography
It is a defence to any charge for an offence under subsection (3) that the material concerned came into the defendant’s possession unsolicited and the defendant, as soon as he or she became aware of its pornographic nature, took reasonable steps to get rid of it.