summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Figuière <hub@figuiere.net>2017-08-02 23:16:10 -0400
committerHubert Figuière <hub@figuiere.net>2017-08-02 23:16:59 -0400
commit9e76a7782a54a242f18d609e7ba32bf1c430a5e4 (patch)
tree5cec9a20fce176769eca8941cfa1aa4837365ec9
parent6ac03205c28418ccde64aa85ad084083fba7eb39 (diff)
Bug 101913 - Prevent an assert from being reached with a corrupt file
- In VPXChunk::width() and VPXChunk::height() ensure val isn't 0.
-rw-r--r--XMPFiles/source/FormatSupport/WEBP_Support.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
index 2b007de..a211697 100644
--- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
@@ -141,7 +141,7 @@ XMP_Uns32 VP8XChunk::width()
}
void VP8XChunk::width(XMP_Uns32 val)
{
- PutLE24(&this->data[4], val - 1);
+ PutLE24(&this->data[4], val > 0 ? val - 1 : 0);
}
XMP_Uns32 VP8XChunk::height()
{
@@ -149,7 +149,7 @@ XMP_Uns32 VP8XChunk::height()
}
void VP8XChunk::height(XMP_Uns32 val)
{
- PutLE24(&this->data[7], val - 1);
+ PutLE24(&this->data[7], val > 0 ? val - 1 : 0);
}
bool VP8XChunk::xmp()
{