I don't know that much about PDFs but I've been looking at how ImageMagick renders PDFs and I think the implementation is incorrect.
In coders/pdf.c:447-448 it seems to assume a document is CMYK if it has any ICCBased element.
What if the profile associated with that element is not a CMYK profile?
Would the correct action to take here to analyze the color space of the profile associated with the ICCBased element?