diff options
Diffstat (limited to 'source/blender/imbuf/intern/dds')
-rw-r--r-- | source/blender/imbuf/intern/dds/dds_api.cpp | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dds/dds_api.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp index 56880c57f1b..9a106253397 100644 --- a/source/blender/imbuf/intern/dds/dds_api.cpp +++ b/source/blender/imbuf/intern/dds/dds_api.cpp @@ -31,13 +31,12 @@ extern "C" { #include "imbuf.h" -#include "imbuf_patch.h" #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" #include "IMB_allocimbuf.h" -short imb_save_dds(struct ImBuf * ibuf, char *name, int flags) +int imb_save_dds(struct ImBuf * ibuf, char *name, int flags) { return(0); /* todo: finish this function */ @@ -78,6 +77,9 @@ struct ImBuf *imb_load_dds(unsigned char *mem, int size, int flags) Color32 pixel; Color32 *pixels = 0; + if(!imb_is_a_dds(mem)) + return (0); + /* check if DDS is valid and supported */ if (!dds.isValid()) { /* no need to print error here, just testing if it is a DDS */ diff --git a/source/blender/imbuf/intern/dds/dds_api.h b/source/blender/imbuf/intern/dds/dds_api.h index b8a61c6fc1a..6d9fa0839dd 100644 --- a/source/blender/imbuf/intern/dds/dds_api.h +++ b/source/blender/imbuf/intern/dds/dds_api.h @@ -29,7 +29,7 @@ extern "C" { #endif -short imb_save_dds(struct ImBuf *ibuf, char *name, int flags); +int imb_save_dds(struct ImBuf *ibuf, char *name, int flags); int imb_is_a_dds(unsigned char *mem); /* use only first 32 bytes of mem */ struct ImBuf *imb_load_dds(unsigned char *mem, int size, int flags); |