]> granicus.if.org Git - imagemagick/commitdiff
Use macro for constants instead of value to improve readability.
authorDirk Lemstra <dirk@lemstra.org>
Fri, 4 Oct 2019 10:22:08 +0000 (12:22 +0200)
committerDirk Lemstra <dirk@lemstra.org>
Fri, 4 Oct 2019 10:22:08 +0000 (12:22 +0200)
coders/bmp.c

index c964834fe8874bfe18ca86792535789f537761c5..2f6b0eb57f4752b36bb34eeab83e095ebb96873e 100644 (file)
@@ -847,11 +847,11 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
     if (bmp_info.bits_per_pixel < 16 &&
         bmp_info.number_colors > (1U << bmp_info.bits_per_pixel))
       ThrowReaderException(CorruptImageError,"UnrecognizedNumberOfColors");
-    if ((bmp_info.compression == 1) && (bmp_info.bits_per_pixel != 8))
+    if ((bmp_info.compression == BI_RLE8) && (bmp_info.bits_per_pixel != 8))
       ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel");
-    if ((bmp_info.compression == 2) && (bmp_info.bits_per_pixel != 4))
+    if ((bmp_info.compression == BI_RLE4) && (bmp_info.bits_per_pixel != 4))
       ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel");
-    if ((bmp_info.compression == 3) && (bmp_info.bits_per_pixel < 16))
+    if ((bmp_info.compression == BI_BITFIELDS) && (bmp_info.bits_per_pixel < 16))
       ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel");
     switch (bmp_info.compression)
     {