diff options
author | Hubert Figuière <hub@figuiere.net> | 2017-08-02 23:16:10 -0400 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2017-08-03 22:04:00 -0400 |
commit | 397db4b18ef85a9158d52744bc9e5092040fbd42 (patch) | |
tree | 91e183c51a18ac54cef09dc9e26d33ce21cee9cc /XMPFiles/source | |
parent | 0320c32a388964498911d7ebdec6561687d2f6c6 (diff) |
2.4.x: Bug 101913 - Prevent an assert from being reached with a corrupt file
- In VPXChunk::width() and VPXChunk::height() ensure val isn't 0.
Diffstat (limited to 'XMPFiles/source')
-rw-r--r-- | XMPFiles/source/FormatSupport/WEBP_Support.cpp | 4 |
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() { |