This seemed to happen if the 'file' variable was NULL. For some reason, magickcore would just totally freeze.
MagickCore is provided here as an alternative to FFmpeg in case FFmpeg is not easily supported (for example, debian-based linux distros). NOTE: Cmake configuration needs to be changed in order to allow MagickCore image support.