summaryrefslogtreecommitdiff
path: root/plugins/AdvaImg/src/FreeImage/PSDParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AdvaImg/src/FreeImage/PSDParser.cpp')
-rw-r--r--plugins/AdvaImg/src/FreeImage/PSDParser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/AdvaImg/src/FreeImage/PSDParser.cpp b/plugins/AdvaImg/src/FreeImage/PSDParser.cpp
index 57c703a06f..fba54c2421 100644
--- a/plugins/AdvaImg/src/FreeImage/PSDParser.cpp
+++ b/plugins/AdvaImg/src/FreeImage/PSDParser.cpp
@@ -506,6 +506,10 @@ bool psdParser::ReadImageResources(FreeImageIO *io, fi_handle handle, LONG lengt
oResource.Reset();
n = (int)io->read_proc(&oResource._OSType, sizeof(oResource._OSType), 1, handle);
+ if(n != 1) {
+ FreeImage_OutputMessageProc(_fi_format_id, "This file contains damaged data causing an unexpected end-of-file - stop reading resources");
+ return false;
+ }
nBytes += n * sizeof(oResource._OSType);
if( (nBytes % 2) != 0 ) {