diff --git a/OpenEXR/IlmImf/ImfDwaCompressor.cpp b/OpenEXR/IlmImf/ImfDwaCompressor.cpp index 8dc0885e42..fb359aae8e 100644 --- a/OpenEXR/IlmImf/ImfDwaCompressor.cpp +++ b/OpenEXR/IlmImf/ImfDwaCompressor.cpp @@ -2422,7 +2422,7 @@ DwaCompressor::uncompress unsigned short ruleSize = 0; Xdr::read(dataPtr, ruleSize); - if (ruleSize < 0) + if (ruleSize < Xdr::size() ) throw IEX_NAMESPACE::InputExc("Error uncompressing DWA data" " (corrupt header file).");