]> granicus.if.org Git - imagemagick/commitdiff
Fix uncompressed DDS header pitch
authorHrnchamd <iamalannoble@hotmail.com>
Tue, 23 Feb 2016 22:19:01 +0000 (22:19 +0000)
committerdirk <dirk@git.imagemagick.org>
Sun, 3 Apr 2016 17:54:01 +0000 (19:54 +0200)
The pitch value is supposed to be in bytes, not bits.

coders/dds.c

index 07e60d31c5ac42358f3930b8dce758390d4195bc..a966151dbb279750d322bca7187546444e6a9ae4 100644 (file)
@@ -2731,9 +2731,9 @@ static void WriteDDSInfo(Image *image, const size_t pixelFormat,
     {
       // Uncompressed DDS requires byte pitch of first image
       if (image->alpha_trait != UndefinedPixelTrait)
-        (void) WriteBlobLSBLong(image,(unsigned int) (image->columns * 32));
+        (void) WriteBlobLSBLong(image,(unsigned int) (image->columns * 4));
       else
-        (void) WriteBlobLSBLong(image,(unsigned int) (image->columns * 24));
+        (void) WriteBlobLSBLong(image,(unsigned int) (image->columns * 3));
     }
 
   (void) WriteBlobLSBLong(image,0x00);