summaryrefslogtreecommitdiff
path: root/XMPFiles/source/FormatSupport/RIFF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'XMPFiles/source/FormatSupport/RIFF.cpp')
-rw-r--r--XMPFiles/source/FormatSupport/RIFF.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/XMPFiles/source/FormatSupport/RIFF.cpp b/XMPFiles/source/FormatSupport/RIFF.cpp
index a4e7e05..8cd76ca 100644
--- a/XMPFiles/source/FormatSupport/RIFF.cpp
+++ b/XMPFiles/source/FormatSupport/RIFF.cpp
@@ -186,6 +186,10 @@ Chunk::Chunk( ContainerChunk* _parent, RIFF_MetaHandler* handler, bool skip, Chu
bool repairFile = XMP_OptionIsSet ( handler->parent->openFlags, kXMPFiles_OpenRepairFile );
if ( (! isUpdate) || (repairFile && (_parent == 0)) ) {
this->oldSize = chunkLimit - this->oldPos;
+ if (this->oldSize < 8)
+ {
+ XMP_Throw("Invalid RIFF chunk size", kXMPErr_BadFileFormat);
+ }
} else {
XMP_Throw ( "Bad RIFF chunk size", kXMPErr_BadFileFormat );
}