]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1525
authorCristy <mikayla-grace@urban-warrior.org>
Sat, 23 Mar 2019 17:48:05 +0000 (13:48 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Sat, 23 Mar 2019 17:48:43 +0000 (13:48 -0400)
MagickCore/quantum-import.c
coders/psd.c

index b3db3f84c7bef234172738436c187def541af9ee..3b0c01e0587b1228de2f3cf1094772cab93ea3c5 100644 (file)
@@ -160,8 +160,9 @@ static inline const unsigned char *PushDoublePixel(QuantumInfo *quantum_info,
   return(pixels);
 }
 
-static inline const unsigned char *PushQuantumFloatPixel(QuantumInfo *quantum_info,
-  const unsigned char *magick_restrict pixels,float *pixel)
+static inline const unsigned char *PushQuantumFloatPixel(
+  QuantumInfo *quantum_info,const unsigned char *magick_restrict pixels,
+  float *pixel)
 {
   float
     *p;
index 36439f657c89775be036ab6b776f7ed46bebedff..8561c2a73e71e154802207e7f065d9fab346d62c 100644 (file)
@@ -312,7 +312,8 @@ static MagickBooleanType CorrectPSDAlphaBlend(const ImageInfo *image_info,
   ssize_t
     y;
 
-  if (image->alpha_trait != BlendPixelTrait || image->colorspace != sRGBColorspace)
+  if ((image->alpha_trait != BlendPixelTrait) ||
+      (image->colorspace != sRGBColorspace))
     return(MagickTrue);
   option=GetImageOption(image_info,"psd:alpha-unblend");
   if (IsStringFalse(option) != MagickFalse)
@@ -334,10 +335,10 @@ static MagickBooleanType CorrectPSDAlphaBlend(const ImageInfo *image_info,
       continue;
     q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
     if (q == (Quantum *) NULL)
-    {
-      status=MagickFalse;
-      continue;
-    }
+      {
+        status=MagickFalse;
+        continue;
+      }
     for (x=0; x < (ssize_t) image->columns; x++)
     {
       double
@@ -533,7 +534,7 @@ static void PreservePSDOpacityMask(Image *image,LayerInfo* layer_info,
   random_info=AcquireRandomInfo();
   key_info=GetRandomKey(random_info,2+1);
   key=(char *) GetStringInfoDatum(key_info);
-  key[8]=(char ) layer_info->mask.background;
+  key[8]=(char) layer_info->mask.background;
   key[9]='\0';
   layer_info->mask.image->page.x+=layer_info->page.x;
   layer_info->mask.image->page.y+=layer_info->page.y;
@@ -1021,22 +1022,23 @@ static MagickBooleanType ReadPSDChannelPixels(Image *image,
   {
     if (packet_size == 1)
       pixel=ScaleCharToQuantum(*p++);
-    else if (packet_size == 2)
-      {
-        unsigned short
-          nibble;
-
-        p=PushShortPixel(MSBEndian,p,&nibble);
-        pixel=ScaleShortToQuantum(nibble);
-      }
     else
-      {
-        MagickFloatType
-          nibble;
+      if (packet_size == 2)
+        {
+          unsigned short
+            nibble;
 
-        p=PushFloatPixel(MSBEndian,p,&nibble);
-        pixel=ClampToQuantum((MagickRealType)QuantumRange*nibble);
-      }
+          p=PushShortPixel(MSBEndian,p,&nibble);
+          pixel=ScaleShortToQuantum(nibble);
+        }
+      else
+        {
+          MagickFloatType
+            nibble;
+
+          p=PushFloatPixel(MSBEndian,p,&nibble);
+          pixel=ClampToQuantum((MagickRealType) (QuantumRange*nibble));
+        }
     if (image->depth > 1)
       {
         SetPSDPixel(image,channels,type,packet_size,pixel,q,exception);