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:
Diffstat (limited to 'source/blender/imbuf/intern/dds/DirectDrawSurface.cpp')
-rw-r--r--source/blender/imbuf/intern/dds/DirectDrawSurface.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
index 16a7525bb80..76de84cdee5 100644
--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
@@ -1148,6 +1148,12 @@ void *DirectDrawSurface::readData(uint &rsize)
stream.seek(header_size);
mem_read(stream, data, size);
+ if (stream.failed) {
+ free(data);
+ data = NULL;
+ rsize = 0;
+ }
+
// Maybe check if size == rsize? assert() isn't in this scope...
return data;