The PDF document in question is corrupt, and note that even Adobe Reader (i.e. the PDF reference implementation) cannot render it correctly. Also, guard all other set fill/stroke color operators similarly.