]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 7 Apr 2013 22:36:07 +0000 (22:36 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 7 Apr 2013 22:36:07 +0000 (22:36 +0000)
MagickCore/xwindow.c

index edb4f61f6abe19806c7648d67f2b82f07e1ce472..7db9ac39888688389f338cef79ed8874b987596e 100644 (file)
@@ -6129,9 +6129,6 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info,
           register unsigned int
             bytes_per_pixel;
 
-          unsigned char
-            channel[sizeof(size_t)];
-
           /*
             Convert to multi-byte color-mapped X canvas.
           */
@@ -6147,11 +6144,9 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info,
               pixel=pixels[(ssize_t) GetPixelIndex(canvas,p)];
               for (k=0; k < (int) bytes_per_pixel; k++)
               {
-                channel[k]=(unsigned char) pixel;
+                *q++=(unsigned char) (pixel & 0xff);
                 pixel>>=8;
               }
-              for (k=0; k < (int) bytes_per_pixel; k++)
-                *q++=channel[k];
               p+=GetPixelChannels(canvas);
             }
             q+=scanline_pad;
@@ -6381,13 +6376,9 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info,
                 register unsigned int
                   bytes_per_pixel;
 
-                unsigned char
-                  channel[sizeof(size_t)];
-
                 /*
                   Convert to multi-byte continuous-tone X canvas.
                 */
-                (void) ResetMagickMemory(channel,0,sizeof(channel));
                 bytes_per_pixel=(unsigned int) (ximage->bits_per_pixel >> 3);
                 for (y=0; y < (int) canvas->rows; y++)
                 {
@@ -6400,11 +6391,9 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info,
                     pixel=XGammaPixel(canvas,map_info,p);
                     for (k=0; k < (int) bytes_per_pixel; k++)
                     {
-                      channel[k]=(unsigned char) pixel;
+                      *q++=(unsigned char) (pixel & 0xff);
                       pixel>>=8;
                     }
-                    for (k=0; k < (int) bytes_per_pixel; k++)
-                      *q++=channel[k];
                     p+=GetPixelChannels(canvas);
                   }
                   q+=scanline_pad;