summaryrefslogtreecommitdiff
path: root/plugins/AdvaImg/src/FreeImage/PluginDDS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AdvaImg/src/FreeImage/PluginDDS.cpp')
-rw-r--r--plugins/AdvaImg/src/FreeImage/PluginDDS.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/AdvaImg/src/FreeImage/PluginDDS.cpp b/plugins/AdvaImg/src/FreeImage/PluginDDS.cpp
index 0a1667d7f1..639942388f 100644
--- a/plugins/AdvaImg/src/FreeImage/PluginDDS.cpp
+++ b/plugins/AdvaImg/src/FreeImage/PluginDDS.cpp
@@ -378,6 +378,10 @@ template <class DECODER> void DecodeDXTBlock (BYTE *dstData, const BYTE *srcBloc
decoder.SetY (y);
for (int x = 0; x < bw; x++) {
decoder.GetColor (x, y, (Color8888 &)*dst);
+
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB
+ INPLACESWAP(dst[FI_RGBA_RED], dst[FI_RGBA_BLUE]);
+#endif
dst += 4;
}
}
@@ -444,7 +448,7 @@ LoadDXT_Helper (FreeImageIO *io, fi_handle handle, int page, int flags, void *da
typedef typename INFO::Block Block;
Block *input_buffer = new(std::nothrow) Block[(width + 3) / 4];
- if (!input_buffer) return;
+ if(!input_buffer) return;
int widthRest = (int) width & 3;
int heightRest = (int) height & 3;