From: Guillermo Rodriguez Garcia <guille@iies.es>
Date: Sun, 29 Aug 1999 20:02:07 +0000 (+0000)
Subject: fixed bug for 24bit images
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f0d922cf78ff8f84a91748e9092487b86cdf76ca

fixed bug for 24bit images


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp
index 7c8c0c0c05..f8c0363624 100644
--- a/src/common/imagpcx.cpp
+++ b/src/common/imagpcx.cpp
@@ -142,14 +142,17 @@ int ReadPCX(wxImage *image, wxInputStream& stream)
     // palette at the end of the file. Read it now before
     // proceeding.
     //
-    pos = stream.TellI();
-    stream.SeekI(-769, wxFromEnd);
+    if (format == IMAGE_8BIT)
+    {
+        pos = stream.TellI();
+        stream.SeekI(-769, wxFromEnd);
 
-    if (stream.GetC() != 12)
-        return E_FORMATO;
+        if (stream.GetC() != 12)
+            return E_FORMATO;
 
-    stream.Read(pal, 768);
-    stream.SeekI(pos, wxFromStart);
+        stream.Read(pal, 768);
+        stream.SeekI(pos, wxFromStart);
+    }
 
     // Allocate memory for a scanline and resize the image.
     //