summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()
{