diff --git a/coders/dpx.c b/coders/dpx.c
index 5d0e524..c2f6e26 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -1803,7 +1803,8 @@
}
extent=GetBytesPerRow(image->columns,image->matte != MagickFalse ? 4UL : 3UL,
image->depth,MagickTrue);
- if ((image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
+ if ((image_info->type != UndefinedColorType) &&
+ (image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
(IsGrayImage(image,&image->exception) != MagickFalse))
{
quantum_type=GrayQuantum;