Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
and your program should work. You should always check the return value. In your program pixels was being returned as NULL and you can't write to a NULL pointer.