Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-04-16 04:39:29 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-04-16 04:41:17 +0300
commitdb80d5c560f55eaaad2702a4dae61b4b9c027e26 (patch)
tree8b6cb721cea99c29e615429adf8d7f37996af552 /source/blender/imbuf/intern/dds/dds_api.cpp
parent6a50a3d140d7050dcfa391eb55d5a03720b06f3a (diff)
Fix T62852: crash reading corrupt DDS file.
Diffstat (limited to 'source/blender/imbuf/intern/dds/dds_api.cpp')
-rw-r--r--source/blender/imbuf/intern/dds/dds_api.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp
index 37577eefc56..fa88f81b55a 100644
--- a/source/blender/imbuf/intern/dds/dds_api.cpp
+++ b/source/blender/imbuf/intern/dds/dds_api.cpp
@@ -165,7 +165,9 @@ struct ImBuf *imb_load_dds(const unsigned char *mem, size_t size, int flags, cha
ibuf->dds_data.data = (unsigned char *)dds.readData(ibuf->dds_data.size);
/* flip compressed texture */
- FlipDXTCImage(dds.width(), dds.height(), dds.mipmapCount(), dds.fourCC(), ibuf->dds_data.data);
+ if (ibuf->dds_data.data) {
+ FlipDXTCImage(dds.width(), dds.height(), dds.mipmapCount(), dds.fourCC(), ibuf->dds_data.data);
+ }
}
else {
ibuf->dds_data.data = NULL;