diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-16 04:39:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-16 04:41:17 +0300 |
commit | db80d5c560f55eaaad2702a4dae61b4b9c027e26 (patch) | |
tree | 8b6cb721cea99c29e615429adf8d7f37996af552 /source/blender/imbuf/intern/dds/dds_api.cpp | |
parent | 6a50a3d140d7050dcfa391eb55d5a03720b06f3a (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.cpp | 4 |
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; |