From 70eb0fe575c4daaddcef24098dacd01b340d836c Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 4 Oct 2019 12:22:08 +0200 Subject: [PATCH] Use macro for constants instead of value to improve readability. --- coders/bmp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coders/bmp.c b/coders/bmp.c index c964834fe..2f6b0eb57 100644 --- a/coders/bmp.c +++ b/coders/bmp.c @@ -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) { -- 2.40.0