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/DirectDrawSurface.cpp
parent6a50a3d140d7050dcfa391eb55d5a03720b06f3a (diff)
Fix T62852: crash reading corrupt DDS file.
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;