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/Stream.h | |
parent | 6a50a3d140d7050dcfa391eb55d5a03720b06f3a (diff) |
Fix T62852: crash reading corrupt DDS file.
Diffstat (limited to 'source/blender/imbuf/intern/dds/Stream.h')
-rw-r--r-- | source/blender/imbuf/intern/dds/Stream.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/dds/Stream.h b/source/blender/imbuf/intern/dds/Stream.h index 3da0feb5aeb..b9fba2ef8b2 100644 --- a/source/blender/imbuf/intern/dds/Stream.h +++ b/source/blender/imbuf/intern/dds/Stream.h @@ -28,8 +28,10 @@ struct Stream { unsigned char *mem; // location in memory unsigned int size; // size unsigned int pos; // current position - Stream(unsigned char *m, unsigned int s) : mem(m), size(s), pos(0) {} + bool failed; // error occured when seeking + Stream(unsigned char *m, unsigned int s) : mem(m), size(s), pos(0), failed(false) {} unsigned int seek(unsigned int p); + void set_failed(const char *msg); }; unsigned int mem_read(Stream & mem, unsigned long long & i); |