diff --git a/CHANGES.md b/CHANGES.md
index 4e01dab6e0d72c6c9546bf14fc4da19d1895a94a..4f70c53442277bfb9a9ae8a6b2f67945e2e469ef 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,5 +1,6 @@
 # OpenEXR Release Notes
 
+* [Version 2.5.3](#version-253-august-12-2020) August 12, 2020
 * [Version 2.5.2](#version-252-june-15-2020) June 15, 2020
 * [Version 2.5.1](#version-251-may-11-2020) May 11, 2020
 * [Version 2.5.0](#version-250-may-6-2020) May 6, 2020
@@ -36,16 +37,104 @@
 * [Version 1.0.1](#version-101)
 * [Version 1.0](#version-10)
 
+## Version 2.5.3 (August 12, 2020)
+
+Patch release with various bug/security fixes and build/install fixes, plus a performance optimization:
+
+### Summary
+
+* Various sanitizer/fuzz-identified issues related to handling of invalid input
+* Fixes to misc compiler warnings
+* Cmake fix for building on arm64 macOS (#772)
+* Read performance optimization (#782)
+* Fix for building on non-glibc (#798)
+* Fixes to tests
+
+### Merged Pull Requests
+
+* [812](https://github.com/AcademySoftwareFoundation/openexr/pull/812) free memory if precalculateTileInfo throws
+* [809](https://github.com/AcademySoftwareFoundation/openexr/pull/809) Avoid integer overflow in calculateNumTiles() 
+* [806](https://github.com/AcademySoftwareFoundation/openexr/pull/806) suppress clang undefined behavior sanitizer in EnvmapAttribute::copyValuesFrom() 
+* [805](https://github.com/AcademySoftwareFoundation/openexr/pull/805) remove extraneous vector allocation in getScanlineChunkOffsetTableSize 
+* [804](https://github.com/AcademySoftwareFoundation/openexr/pull/804) prevent invalid tile description enums
+* [803](https://github.com/AcademySoftwareFoundation/openexr/pull/803) Fix stack corruption in Matrix tests
+* [801](https://github.com/AcademySoftwareFoundation/openexr/pull/801) prevent invalid Compression enum values being read from file
+* [798](https://github.com/AcademySoftwareFoundation/openexr/pull/798) IexMathFpu.cpp: Fix build on non-glibc (e.g. musl libc)
+* [795](https://github.com/AcademySoftwareFoundation/openexr/pull/795) prevent invalid values in LineOrder enum
+* [794](https://github.com/AcademySoftwareFoundation/openexr/pull/794) suppress clang undefined behavior sanitizer in DeepImageStateAttribute::copyValuesFrom()
+* [793](https://github.com/AcademySoftwareFoundation/openexr/pull/793) sanityCheckDisplayWindow() ensures that width and height don't cause integer overflow
+* [792](https://github.com/AcademySoftwareFoundation/openexr/pull/792) cast signed chars to unsigned longs before left shift in Xdr::read of signed long
+* [788](https://github.com/AcademySoftwareFoundation/openexr/pull/788) use 64 bit computation in chunk offset table reconstruction
+* [787](https://github.com/AcademySoftwareFoundation/openexr/pull/787) change sanity check in stringvectorattribute to prevent overflow
+* [785](https://github.com/AcademySoftwareFoundation/openexr/pull/785) prevent invalid values in Channel's PixelType enum
+* [784](https://github.com/AcademySoftwareFoundation/openexr/pull/784) sanity check preview attribute sizes
+* [783](https://github.com/AcademySoftwareFoundation/openexr/pull/783) explicitly cast signed chars to unsigned before bitwise left shift in Xdr::read()
+* [782](https://github.com/AcademySoftwareFoundation/openexr/pull/782) refactor: use local loop variable in copyFromFrameBuffer
+* [778](https://github.com/AcademySoftwareFoundation/openexr/pull/778) Sanity check stringvector size fields on read
+* [777](https://github.com/AcademySoftwareFoundation/openexr/pull/777) IlmImfFuzzTest reports incorrect test names and missing files as errors
+* [775](https://github.com/AcademySoftwareFoundation/openexr/pull/775) Removes overridden find_package in CMakeLists.txt
+* [772](https://github.com/AcademySoftwareFoundation/openexr/pull/772) Disable OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX when building on arm64 macOS
+* [770](https://github.com/AcademySoftwareFoundation/openexr/pull/770) IlmImf: Fix clang compiler warnings
+* [738](https://github.com/AcademySoftwareFoundation/openexr/pull/738) always ignore chunkCount attribute unless it cannot be computed #738
+
+### Commits \[ git log v2.5.2...v2.5.3\]
+
+* [425c104f](https://github.com/AcademySoftwareFoundation/openexr/commit/425c104f7ae9e8e17cc3d9d120d684b93195c402) free memory if precalculateTileInfo throws ([Peter Hillman](@peterh@wetafx.co.nz) 2020-08-10)
+* [7212e337](https://github.com/AcademySoftwareFoundation/openexr/commit/7212e33729e036d16fb5fd3494af815869771963) Set LIBTOOL_VERSION to 25:2:0 for 2.5.3 ([Cary Phillips](@cary@ilm.com) 2020-08-09)
+* [0b6d5185](https://github.com/AcademySoftwareFoundation/openexr/commit/0b6d5185d99bff1c4ab7b2fe00d297ef2fcd46e8) Release notes for 2.5.3 ([Cary Phillips](@cary@ilm.com) 2020-08-09)
+* [6b55722b](https://github.com/AcademySoftwareFoundation/openexr/commit/6b55722b4477e8d4aed04fbeb6b9f5b4226d2bbd) Bump version to 2.5.3 and LIBTOOL_CURRENT to 26 ([Cary Phillips](@cary@ilm.com) 2020-08-09)
+* [40a7ed76](https://github.com/AcademySoftwareFoundation/openexr/commit/40a7ed76cde1427aa6c935565de96f7ee10d9f76) Change >= to > in overflow calculation ([Cary Phillips](@cary@ilm.com) 2020-08-08)
+* [b10412d5](https://github.com/AcademySoftwareFoundation/openexr/commit/b10412d55964459e04ff95f982fd8ce2ded4ea43) Avoid integer overflow in calculateNumTiles() ([Cary Phillips](@cary@ilm.com) 2020-08-08)
+* [ed469311](https://github.com/AcademySoftwareFoundation/openexr/commit/ed469311ac17a8912e2c4cb14856aa2b7f228fac) reformatted references to CVEs in CHANGES.md ([Cary Phillips](@cary@ilm.com) 2020-07-07)
+* [f7c8a7a1](https://github.com/AcademySoftwareFoundation/openexr/commit/f7c8a7a11a69579d8618f31d0e4a1b7bcc20e939) Add references to CVE-2020-15304, CVE-2020-15305, CVE-2020-15306 to SECURITY.md and CHANGES.md ([Cary Phillips](@cary@ilm.com) 2020-07-07)
+* [0d226001](https://github.com/AcademySoftwareFoundation/openexr/commit/0d22600163f58c4e3ca20b9f67bd2fe7866e9201) Add #755 to 2.4.2 release notes ([Cary Phillips](@cary@ilm.com) 2020-06-13)
+* [4a4a4f4a](https://github.com/AcademySoftwareFoundation/openexr/commit/4a4a4f4a58a5d34a132655cc82116a383d787e5d) Improved formatting of commits in release notes ([Cary Phillips](@cary@ilm.com) 2020-06-11)
+* [9c42766b](https://github.com/AcademySoftwareFoundation/openexr/commit/9c42766bd0347dccb84a68977d11fab8cc83ae3c) added merged PR's to v2.4.2 release notes. ([Cary Phillips](@cary@ilm.com) 2020-06-11)
+* [cc1809ed](https://github.com/AcademySoftwareFoundation/openexr/commit/cc1809ed27aed48c54cfb730c90bdf570bb18551) Release notes for v2.4.2 ([Cary Phillips](@cary@ilm.com) 2020-06-11)
+* [7fe8d40d](https://github.com/AcademySoftwareFoundation/openexr/commit/7fe8d40db0c2c02da5f7d2a602fb87a630c3c70d) Remove non-code-related PR's and commits from v2.5.2 release notes. ([Cary Phillips](@cary@ilm.com) 2020-06-11)
+* [bc0b229c](https://github.com/AcademySoftwareFoundation/openexr/commit/bc0b229c5618ffdc6337817898e3d145b6854194) add commit history to release notes for v2.5.1 and v2.5.2 ([Cary Phillips](@cary@ilm.com) 2020-06-11)
+* [ba76b8ca](https://github.com/AcademySoftwareFoundation/openexr/commit/ba76b8ca62c2f1d4ccabd2887dc8d09c69102c2f) always ignore chunkCount attribute unless it cannot be computed (#738) ([peterhillman](@peterh@wetafx.co.nz) 2020-05-27)
+* [81818f2a](https://github.com/AcademySoftwareFoundation/openexr/commit/81818f2a9c9336d71b65b194aaecdef493e9122b) suppress clang undefined behavior sanitizer in EnvmapAttribute::copyValuesFrom() ([Peter Hillman](@peterh@wetafx.co.nz) 2020-08-07)
+* [2f83442f](https://github.com/AcademySoftwareFoundation/openexr/commit/2f83442f067788751ce857effa3472bf4f79f743) allow undefined EnvMap enum values for future proofing ([Peter Hillman](@peterh@wetafx.co.nz) 2020-08-07)
+* [485b5fe4](https://github.com/AcademySoftwareFoundation/openexr/commit/485b5fe4d6e575b4af389af98d7a3a2104ce828b) remove extraneous vector allocation in getScanlineChunkOffsetTableSize ([Peter Hillman](@peterh@wetafx.co.nz) 2020-08-06)
+* [7da32d3c](https://github.com/AcademySoftwareFoundation/openexr/commit/7da32d3ccf6d4eace88ffad093f692a4287b2fbf) refactor: use local loop variable in copyFromFrameBuffer ([Gyula Gubacsi](@gyula.gubacsi@foundry.com) 2020-07-14)
+* [1ecaf4bd](https://github.com/AcademySoftwareFoundation/openexr/commit/1ecaf4bdfa00204e17aa2a0f51d1ca7d672a9303) prevent invalid tile description enums ([Peter Hillman](@peterh@wetafx.co.nz) 2020-08-05)
+* [88420f93](https://github.com/AcademySoftwareFoundation/openexr/commit/88420f93857eb2a892683a8a212472883abc8476) prevent invalid Compression enum values being read from file ([Peter Hillman](@peterh@wetafx.co.nz) 2020-07-31)
+* [90736089](https://github.com/AcademySoftwareFoundation/openexr/commit/90736089eb2c51cfdc311de9b5acc337e4a4c49a) Fix out of bounds assignments ([Darby Johnston](@darbyjohnston@yahoo.com) 2020-08-01)
+* [9752e70d](https://github.com/AcademySoftwareFoundation/openexr/commit/9752e70d31193f649eb5286bb649916ecfcc51ea) IexMathFpu.cpp: Fix build on non-glibc (e.g. musl libc). ([Niklas Hambüchen](@mail@nh2.me) 2020-07-30)
+* [37e16a88](https://github.com/AcademySoftwareFoundation/openexr/commit/37e16a88db863da9feeadc721d8df86118c5aab5) cast signed chars to unsigned longs before left shift in read of signed long ([Cary Phillips](@cary@ilm.com) 2020-07-17)
+* [02e1ac54](https://github.com/AcademySoftwareFoundation/openexr/commit/02e1ac54368ef40e493a67d6804bc706e1bd52db) suppress clang undefined behavior sanitizer in DeepImageStateAttribute::copyValuesFrom() ([Cary Phillips](@cary@ilm.com) 2020-07-22)
+* [bf3edf27](https://github.com/AcademySoftwareFoundation/openexr/commit/bf3edf271a638e95120c83cbd794502b55f1c64e) fixed CI and Analysis badges in README.md ([Cary Phillips](@cary@ilm.com) 2020-07-16)
+* [93e9f2ac](https://github.com/AcademySoftwareFoundation/openexr/commit/93e9f2ac3212353414a4e65eb359bcd6dbe7fe6f) prevent invalid values in LineOrder enum ([Cary Phillips](@cary@ilm.com) 2020-07-22)
+* [6bb6257f](https://github.com/AcademySoftwareFoundation/openexr/commit/6bb6257ffb24f375dfcc40568bfd6357dd6028f8) fixed comment ([Cary Phillips](@cary@ilm.com) 2020-07-20)
+* [1a1e13fd](https://github.com/AcademySoftwareFoundation/openexr/commit/1a1e13fd8579900ee9f05c3c12bdf2b2aa994593) sanityCheckDisplayWindow() ensures that width and height don't cause integer overflow ([Cary Phillips](@cary@ilm.com) 2020-07-20)
+* [45e14fdf](https://github.com/AcademySoftwareFoundation/openexr/commit/45e14fdf0700b7afdb94ea7bb788ba9a162d04d7) IlmImfFuzzTest reports incorrect test names and missing files as errors rather than silently succeeding. ([Cary Phillips](@cary@ilm.com) 2020-07-09)
+* [a6bc10f5](https://github.com/AcademySoftwareFoundation/openexr/commit/a6bc10f5f28c19b8338eb2c6c7226bb6408554f7) use ll in chunk size computation ([Peter Hillman](@peterh@wetafx.co.nz) 2020-07-17)
+* [c6058144](https://github.com/AcademySoftwareFoundation/openexr/commit/c6058144b653c8ded2e8c0cf0709186486b2453d) use 64 bit computation in chunkoffsettable reconstruction ([Peter Hillman](@peterh@wetafx.co.nz) 2020-07-17)
+* [b33b1187](https://github.com/AcademySoftwareFoundation/openexr/commit/b33b1187342ff76da08fc7a3ef848b937d7374a3) prevent invalid values in Channel's PixelType enum ([Peter Hillman](@peterh@wetafx.co.nz) 2020-07-16)
+* [b7b8a568](https://github.com/AcademySoftwareFoundation/openexr/commit/b7b8a5685c0db270b4671ef78c388e3a89605e85) change sanity check in stringvectorattribute to prevent overflow (#787) ([peterhillman](@peterh@wetafx.co.nz) 2020-07-17)
+* [09eadd12](https://github.com/AcademySoftwareFoundation/openexr/commit/09eadd12d86763fda854b36524ae37680d8ff4c5) cast signed chars to unsigned before bitwise left shift in Xdr::read() ([Cary Phillips](@cary@ilm.com) 2020-07-14)
+* [3cf874cb](https://github.com/AcademySoftwareFoundation/openexr/commit/3cf874cbbd23d945a0057f10145bd5f3ce2be679) sanity check preview attribute sizes ([Peter Hillman](@peterh@wetafx.co.nz) 2020-07-15)
+* [849c6776](https://github.com/AcademySoftwareFoundation/openexr/commit/849c6776f6627a11710227c026dd4aa6de8f7738) Tidy whitespace in ImfStringVectorAttribute.cpp ([peterhillman](@peterh@wetafx.co.nz) 2020-07-10)
+* [fcaa1691](https://github.com/AcademySoftwareFoundation/openexr/commit/fcaa1691071f90df9202818315f4f9d1bc13c54e) sanity check string vectors on read ([Peter Hillman](@peterh@wetafx.co.nz) 2020-07-10)
+* [0d13c74a](https://github.com/AcademySoftwareFoundation/openexr/commit/0d13c74a3bfa497465c3e42847b9c62089f0454b) Removes overridden find_package in CMakeLists.txt in favor of reusing the generated config files and setting (IlmBase/OpenEXR)_DIR variables Overriding a cmake function is undocumented functionallity and only works one time. Better to avoid if possible. ([Peter Steneteg](@peter@steneteg.se) 2020-06-17)
+* [1343c08a](https://github.com/AcademySoftwareFoundation/openexr/commit/1343c08a7eb13764bbb6c21db22e5a78169754db) Cast to uintptr_t instead of size_t for mask ops on ptrs. ([Arkell Rasiah](@arasiah@pixsystem.com) 2020-06-25)
+* [72de4c9e](https://github.com/AcademySoftwareFoundation/openexr/commit/72de4c9ef32e2e9eb4e6d9499a0fadb96ae28796) Switching to current c++ casting style. ([Arkell Rasiah](@arasiah@pixsystem.com) 2020-06-24)
+* [9534e36d](https://github.com/AcademySoftwareFoundation/openexr/commit/9534e36d1d1993db7a7cc3ba4c58ec4d7a4a8dd5) IlmImf: Fix misc compiler warnings. ([Arkell Rasiah](@arkellrasiah@gmail.com) 2020-06-23)
+* [8e53ab8d](https://github.com/AcademySoftwareFoundation/openexr/commit/8e53ab8d13b1b6c14c716573e6f16d079e799ab4) Disable OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX when building on arm64 macOS ([Yining Karl Li](@betajippity@gmail.com) 2020-07-03)
+* [67b1b88d](https://github.com/AcademySoftwareFoundation/openexr/commit/67b1b88de6ad454a1b267ee9a4e19b4efbdbe19d) Addresses PR#767: Removal of legacy .cvsignore files. ([Arkell Rasiah](@arkellrasiah@gmail.com) 2020-06-19)
+* [801e5d87](https://github.com/AcademySoftwareFoundation/openexr/commit/801e5d8750dd8b8a6e25c131899136c575b20d07) Fix typo in README ([cia-rana](@kiwamura0314@gmail.com) 2020-06-15)
+
 ## Version 2.5.2 (June 15, 2020)
 
 Patch release with various bug/security fixes and build/install fixes.
 
 ### Summary
 
-* Invalid input could cause a heap-use-after-free error in DeepScanLineInputFile::DeepScanLineInputFile()
-* Invalid chunkCount attributes could cause heap buffer overflow in getChunkOffsetTableSize()
-* Invalid tiled input file could cause invalid memory access TiledInputFile::TiledInputFile()
-* OpenEXRConfig.h now correctly sets OPENEXR_PACKAGE_STRING to "OpenEXR" (rather than "IlmBase")
+* [CVE-2020-15305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15305) Invalid input could cause a heap-use-after-free error in DeepScanLineInputFile::DeepScanLineInputFile() 
+* [CVE-2020-15306](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15306) Invalid chunkCount attributes could cause heap buffer overflow in getChunkOffsetTableSize() 
+* [CVE-2020-15304](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15304) Invalid tiled input file could cause invalid memory access TiledInputFile::TiledInputFile() 
+* OpenEXRConfig.h now correctly sets OPENEXR_PACKAGE_STRING to "OpenEXR" (rather than "IlmBase") 
 * Various Windows build fixes
 
 ### Merged Pull Requests
@@ -454,9 +543,9 @@ Minor release with miscellaneous bug fixes and small features
 
 This is a patch release that includes fixes for the following security vulnerabilities:
 
-* Invalid input could cause a heap-use-after-free error in DeepScanLineInputFile::DeepScanLineInputFile()
-* Invalid chunkCount attributes could cause heap buffer overflow in getChunkOffsetTableSize()
-* Invalid tiled input file could cause invalid memory access TiledInputFile::TiledInputFile()
+* [CVE-2020-15305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15305) Invalid input could cause a heap-use-after-free error in DeepScanLineInputFile::DeepScanLineInputFile() 
+* [CVE-2020-15306](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15306) Invalid chunkCount attributes could cause heap buffer overflow in getChunkOffsetTableSize() 
+* [CVE-2020-15304](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15304) Invalid tiled input file could cause invalid memory access TiledInputFile::TiledInputFile() 
 * OpenEXRConfig.h now correctly sets OPENEXR_PACKAGE_STRING to "OpenEXR" (rather than "IlmBase")
 
 ### Merged Pull Requests
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 111a6034ea3351077369d87edae131828b7429ec..bd9f600e331f5044f00ffed3ffab44df896b302b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,18 +24,6 @@ endif()
 
 project(OpenEXRMetaProject)
 
-
-# An "official" way to make this a super-project
-# basically overrides the find_package to not find anything
-# for stuff we're including locally
-set(as_subproject IlmBase OpenEXR)
-macro(find_package)
-  if(NOT "${ARGV0}" IN_LIST as_subproject)
-    _find_package(${ARGV})
-  endif()
-endmacro()
-
-
 # If you want to use ctest to configure, build and
 # upload the results, cmake has builtin support for
 # submitting to CDash, or any server who speaks the
@@ -68,8 +56,23 @@ endif()
 
 # Include these two modules without enable/disable options
 add_subdirectory(IlmBase)
+
+# Tell CMake where to find the IlmBaseConfig.cmake file. Makes it posible to call 
+# find_package(IlmBase) in downstream projects
+set(IlmBase_DIR "${CMAKE_CURRENT_BINARY_DIR}/IlmBase/config" CACHE PATH "" FORCE)
+# Add an empty IlmBaseTargets.cmake file for the config to use. 
+# Can be empty since we already defined the targets in add_subdirectory
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/IlmBase/config/IlmBaseTargets.cmake" "# Dummy file")
+
 add_subdirectory(OpenEXR)
 
+# Tell CMake where to find the OpenEXRConfig.cmake file. Makes it posible to call 
+# find_package(OpenEXR) in downstream projects
+set(OpenEXR_DIR "${CMAKE_CURRENT_BINARY_DIR}/OpenEXR/config" CACHE PATH "" FORCE)
+# Add an empty OpenEXRTargets.cmake file for the config to use. 
+# Can be empty since we already defined the targets in add_subdirectory
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OpenEXR/config/OpenEXRTargets.cmake" "# Dummy file")
+
 # should this just be always on and we conditionally compile what
 # is found and warn otherwise? or error out?
 option(PYILMBASE_ENABLE "Enables configuration of the PyIlmBase module" ON)
diff --git a/IlmBase/.cvsignore b/IlmBase/.cvsignore
deleted file mode 100644
index dbd02a06b9980bca0fccf612d203efd11c2f0aaf..0000000000000000000000000000000000000000
--- a/IlmBase/.cvsignore
+++ /dev/null
@@ -1,17 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
-CVS
diff --git a/IlmBase/Half/.cvsignore b/IlmBase/Half/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/IlmBase/Half/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/IlmBase/HalfTest/.cvsignore b/IlmBase/HalfTest/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/IlmBase/HalfTest/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/IlmBase/Iex/.cvsignore b/IlmBase/Iex/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/IlmBase/Iex/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/IlmBase/IexMath/IexMathFpu.cpp b/IlmBase/IexMath/IexMathFpu.cpp
index ceed658e019b79381872e61e474ad4d532268862..439329e503d5d676a05021668b55289ec69fa2bf 100644
--- a/IlmBase/IexMath/IexMathFpu.cpp
+++ b/IlmBase/IexMath/IexMathFpu.cpp
@@ -281,10 +281,18 @@ restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
 inline void
 restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
 {
+#if defined(__GLIBC__) || defined(__i386__)
     setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal);
+#else
+    setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal);
+#endif
     
     _fpstate * kfp = reinterpret_cast<_fpstate *> (ucon.uc_mcontext.fpregs);
+#if defined(__GLIBC__) || defined(__i386__)
     setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
+#else
+    setMxcsr (kfp->mxcsr, clearExceptions);
+#endif
 }
 
 #endif
diff --git a/IlmBase/IexTest/.cvsignore b/IlmBase/IexTest/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/IlmBase/IexTest/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/IlmBase/IlmThread/.cvsignore b/IlmBase/IlmThread/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/IlmBase/IlmThread/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/IlmBase/Imath/.cvsignore b/IlmBase/Imath/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/IlmBase/Imath/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/IlmBase/ImathTest/.cvsignore b/IlmBase/ImathTest/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/IlmBase/ImathTest/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/IlmBase/ImathTest/testMatrix.cpp b/IlmBase/ImathTest/testMatrix.cpp
index 0f4935850083a067ccc7bf00ee05d2d19a262ef9..564123d69a27f6cf4a32e6ad0e2866ef339414f8 100644
--- a/IlmBase/ImathTest/testMatrix.cpp
+++ b/IlmBase/ImathTest/testMatrix.cpp
@@ -78,7 +78,7 @@ testMatrix ()
 
     IMATH_INTERNAL_NAMESPACE::M22f m1;
     m1[0][0] = 99.0f;
-    m1[1][2] = 101.0f;
+    m1[1][1] = 101.0f;
 
 	IMATH_INTERNAL_NAMESPACE::M22f test(m1);
 	assert(test == m1);
@@ -96,7 +96,7 @@ testMatrix ()
 
 	IMATH_INTERNAL_NAMESPACE::M22d m2;
 	m2[0][0] = 99.0f;
-	m2[1][2] = 101.0f;
+	m2[1][1] = 101.0f;
 
 	IMATH_INTERNAL_NAMESPACE::M22d test(m2);
 	assert(test == m2);
diff --git a/IlmBase/configure.ac b/IlmBase/configure.ac
index 5a204375a4d6494abd1a5b97198d1f4d2aa1d3a9..2723fd1d5d73b843e26d95df5d3878107294fb62 100644
--- a/IlmBase/configure.ac
+++ b/IlmBase/configure.ac
@@ -4,11 +4,11 @@ dnl Copyright Contributors to the OpenEXR Project.
 dnl
 
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(IlmBase, 2.5.2)
+AC_INIT(IlmBase, 2.5.3)
 
 AC_SUBST(ILMBASE_VERSION_MAJOR, 2)
 AC_SUBST(ILMBASE_VERSION_MINOR, 5)
-AC_SUBST(ILMBASE_VERSION_PATCH, 2)
+AC_SUBST(ILMBASE_VERSION_PATCH, 3)
 
 AC_SUBST(ILMBASE_VERSION, ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH})
 AC_SUBST(ILMBASE_VERSION_API, ${ILMBASE_VERSION_MAJOR}_${ILMBASE_VERSION_MINOR})
@@ -22,7 +22,7 @@ AM_MAINTAINER_MODE
 
 
 LIBTOOL_CURRENT=25
-LIBTOOL_REVISION=1
+LIBTOOL_REVISION=2
 LIBTOOL_AGE=0
 LIBTOOL_VERSION=$LIBTOOL_CURRENT:$LIBTOOL_REVISION:$LIBTOOL_AGE
 AC_SUBST(LIBTOOL_VERSION)
diff --git a/OpenEXR/.cvsignore b/OpenEXR/.cvsignore
deleted file mode 100644
index dbd02a06b9980bca0fccf612d203efd11c2f0aaf..0000000000000000000000000000000000000000
--- a/OpenEXR/.cvsignore
+++ /dev/null
@@ -1,17 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
-CVS
diff --git a/OpenEXR/IlmImf/.cvsignore b/OpenEXR/IlmImf/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/IlmImf/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR/IlmImf/ImfChannelListAttribute.cpp b/OpenEXR/IlmImf/ImfChannelListAttribute.cpp
index 5549493097ea2fadd2891df51330995cee9206f1..9f7cbe03d7258daee232d3cbd4abf3b05b0ece1d 100644
--- a/OpenEXR/IlmImf/ImfChannelListAttribute.cpp
+++ b/OpenEXR/IlmImf/ImfChannelListAttribute.cpp
@@ -139,6 +139,19 @@ ChannelListAttribute::readValueFrom (IStream &is,
 	Xdr::read <StreamIO> (is, xSampling);
 	Xdr::read <StreamIO> (is, ySampling);
 
+    //
+    // prevent invalid values being written to PixelType enum
+    // by forcing all unknown types to NUM_PIXELTYPES which is also an invalid
+    // pixel type, but can be used as a PixelType enum value
+    // (Header::sanityCheck will throw an exception when files with invalid PixelTypes are read)
+    //
+      if (type != OPENEXR_IMF_INTERNAL_NAMESPACE::UINT &&
+          type != OPENEXR_IMF_INTERNAL_NAMESPACE::HALF &&
+         type != OPENEXR_IMF_INTERNAL_NAMESPACE::FLOAT)
+      {
+          type = OPENEXR_IMF_INTERNAL_NAMESPACE::NUM_PIXELTYPES;
+      }
+
 	_value.insert (name, Channel (PixelType (type),
 	                              xSampling,
 	                              ySampling,
diff --git a/OpenEXR/IlmImf/ImfCompressionAttribute.cpp b/OpenEXR/IlmImf/ImfCompressionAttribute.cpp
index a32c68935833a36866bce8298ce4148ba1ec3e96..2823c57c69efc7125cf7f7091db8285a616232e2 100644
--- a/OpenEXR/IlmImf/ImfCompressionAttribute.cpp
+++ b/OpenEXR/IlmImf/ImfCompressionAttribute.cpp
@@ -71,6 +71,28 @@ CompressionAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is
 {
     unsigned char tmp;
     Xdr::read <StreamIO> (is, tmp);
+
+    //
+    // prevent invalid values being written to Compressin enum
+    // by forcing all unknown types to NUM_COMPRESSION_METHODS which is also an invalid
+    // pixel type, but can be used as a PixelType enum value
+    // (Header::sanityCheck will throw an exception when files with invalid Compression types are read)
+    //
+
+    if (tmp!= NO_COMPRESSION &&
+      tmp != RLE_COMPRESSION &&
+      tmp != ZIPS_COMPRESSION &&
+      tmp != ZIP_COMPRESSION &&
+      tmp != PIZ_COMPRESSION &&
+      tmp != PXR24_COMPRESSION &&
+      tmp != B44_COMPRESSION &&
+      tmp != B44A_COMPRESSION &&
+      tmp != DWAA_COMPRESSION &&
+      tmp != DWAB_COMPRESSION)
+    {
+        tmp = NUM_COMPRESSION_METHODS;
+    }
+
     _value = Compression (tmp);
 }
 
diff --git a/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp b/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp
index 86a70a640879bc843baf51f1e0b7af88644e559e..05a03571ef64d969c5d4636f5ad9c3ac1ee663eb 100644
--- a/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp
+++ b/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp
@@ -74,5 +74,18 @@ DeepImageStateAttribute::readValueFrom
     _value = DeepImageState (tmp);
 }
 
+template <>
+void
+DeepImageStateAttribute::copyValueFrom (const OPENEXR_IMF_INTERNAL_NAMESPACE::Attribute &other)
+#if defined (__clang__)
+    // _value may be an invalid value, which the clang sanitizer reports
+    // as undefined behavior, even though the value is acceptable in this
+    // context.
+    __attribute__((no_sanitize ("undefined")))
+#endif 
+{
+    _value = cast(other).value();
+
+}
 
 OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT 
diff --git a/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h b/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h
index 6174e9481c550aaa029096cd712ef1162ecddecc..da73e5b6b72b6fd66291b2278d8f0d9e1143e6fe 100644
--- a/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h
+++ b/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h
@@ -62,6 +62,8 @@ template <> IMF_EXPORT
 void DeepImageStateAttribute::readValueFrom
     (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int);
 
+template <> IMF_EXPORT
+void DeepImageStateAttribute::copyValueFrom (const OPENEXR_IMF_INTERNAL_NAMESPACE::Attribute &other);
 
 OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
 
diff --git a/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp b/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp
index 5cca1bbc5a1e13e4fd5d9c330e6aad2537cb96b5..6be42cb78445765ca4a33e45e386e1078293e6b3 100644
--- a/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp
+++ b/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp
@@ -582,7 +582,7 @@ TileBufferTask::execute ()
         // Uncompress the data, if necessary
         //
 
-        if (_tileBuffer->compressor && _tileBuffer->dataSize < Int64(sizeOfTile))
+        if (_tileBuffer->compressor && _tileBuffer->dataSize < static_cast<Int64>(sizeOfTile))
         {
             _tileBuffer->format = _tileBuffer->compressor->format();
 
@@ -605,7 +605,7 @@ TileBufferTask::execute ()
 	// sanity check data size: the uncompressed data should be exactly 
 	// 'sizeOfTile' (if it's less, the file is corrupt and there'll be a buffer overrun)
 	//
-        if(_tileBuffer->dataSize != sizeOfTile)
+        if (_tileBuffer->dataSize != static_cast<Int64>(sizeOfTile))
 	{
 		THROW (IEX_NAMESPACE::InputExc, "size mismatch when reading deep tile: expected " << sizeOfTile << "bytes of uncompressed data but got " << _tileBuffer->dataSize);
 	}
@@ -1800,7 +1800,7 @@ DeepTiledInputFile::readPixelSampleCounts (int dx1, int dx2,
                 // @TODO refactor the compressor code to ensure full 64-bit support.
                 //
 
-                Int64 compressorMaxDataSize = Int64(std::numeric_limits<int>::max());
+                Int64 compressorMaxDataSize = static_cast<Int64>(std::numeric_limits<int>::max());
                 if (dataSize         > compressorMaxDataSize ||
                     unpackedDataSize > compressorMaxDataSize ||
                     tableSize        > compressorMaxDataSize)
diff --git a/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp b/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp
index 9654e3116e01401880ad10819913a42f153c3d1b..887c0329a8d6407e5f32090d20e46172b15913e7 100644
--- a/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp
+++ b/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp
@@ -1237,7 +1237,7 @@ DeepTiledOutputFile::initialize (const Header &header)
                                       _data->numYTiles);
                                       
     //ignore the existing value of chunkCount - correct it if it's wrong
-    _data->header.setChunkCount(getChunkOffsetTableSize(_data->header,true));                                   
+    _data->header.setChunkCount(getChunkOffsetTableSize(_data->header));
                                       
     _data->maxSampleCountTableSize = _data->tileDesc.ySize *
                                      _data->tileDesc.xSize *
diff --git a/OpenEXR/IlmImf/ImfDwaCompressor.cpp b/OpenEXR/IlmImf/ImfDwaCompressor.cpp
index fb359aae8e30eb42df7c67e049ea3adfe52f32f4..4eb4f06e54adf22bf07995dfc99335994b2ab675 100644
--- a/OpenEXR/IlmImf/ImfDwaCompressor.cpp
+++ b/OpenEXR/IlmImf/ImfDwaCompressor.cpp
@@ -742,7 +742,7 @@ DwaCompressor::LossyDctDecoderBase::execute ()
 
     for (int i = 0; i < _SSE_ALIGNMENT; ++i)
     {
-        if (((size_t)(rowBlockHandle + i) & _SSE_ALIGNMENT_MASK) == 0)
+        if ((reinterpret_cast<uintptr_t>(rowBlockHandle + i) & _SSE_ALIGNMENT_MASK) == 0)
             rowBlock[0] = (unsigned short *)(rowBlockHandle + i);
     }
 
@@ -1010,7 +1010,7 @@ DwaCompressor::LossyDctDecoderBase::execute ()
 
             for (int y = 8 * blocky; y < 8 * blocky + maxY; ++y)
             {
-                if ((size_t)_rowPtrs[comp][y] & _SSE_ALIGNMENT_MASK)
+                if (reinterpret_cast<uintptr_t>(_rowPtrs[comp][y]) & _SSE_ALIGNMENT_MASK)
                     fastPath = false;
             }
 
@@ -2820,7 +2820,7 @@ DwaCompressor::uncompress
                     //
                     // sanity check for buffer data lying within range
                     //
-                    if (cd->planarUncBufferEnd + dstScanlineSize - _planarUncBuffer[UNKNOWN] > _planarUncBufferSize[UNKNOWN] )
+                    if ((cd->planarUncBufferEnd + static_cast<size_t>(dstScanlineSize))  > (_planarUncBuffer[UNKNOWN] + _planarUncBufferSize[UNKNOWN]) )
                     {
                         throw Iex::InputExc("DWA data corrupt");
                     }
diff --git a/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp b/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp
index b6f88c27d11c8bc37ccc452c93acdd4d6a2ecd12..a08e45e0219ec0e249f84f32e3c96f3bc3d98345 100644
--- a/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp
+++ b/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp
@@ -72,5 +72,18 @@ EnvmapAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int
     _value = Envmap (tmp);
 }
 
+template <>
+void
+EnvmapAttribute::copyValueFrom (const OPENEXR_IMF_INTERNAL_NAMESPACE::Attribute &other)
+#if defined (__clang__)
+    // _value may be an invalid value, which the clang sanitizer reports
+    // as undefined behavior, even though the value is acceptable in this
+    // context.
+    __attribute__((no_sanitize ("undefined")))
+#endif
+{
+    _value = cast(other).value();
+
+}
 
 OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT 
diff --git a/OpenEXR/IlmImf/ImfEnvmapAttribute.h b/OpenEXR/IlmImf/ImfEnvmapAttribute.h
index 0d0129b80a12d88083d436fdb1adc7026ad98626..5036eca22809402393645a406390e3b7ce1012f4 100644
--- a/OpenEXR/IlmImf/ImfEnvmapAttribute.h
+++ b/OpenEXR/IlmImf/ImfEnvmapAttribute.h
@@ -61,7 +61,9 @@ template <> IMF_EXPORT
 void EnvmapAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &,
                                      int,
                                      int);
-
+template <> IMF_EXPORT
+void
+EnvmapAttribute::copyValueFrom (const OPENEXR_IMF_INTERNAL_NAMESPACE::Attribute &other);
 
 OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
 
diff --git a/OpenEXR/IlmImf/ImfHeader.cpp b/OpenEXR/IlmImf/ImfHeader.cpp
index 6d63cd2e1c87bd8367464b172ac4d5e9d03db14d..2c2f8b1d65c914726a7084cd47042a806857ca3f 100644
--- a/OpenEXR/IlmImf/ImfHeader.cpp
+++ b/OpenEXR/IlmImf/ImfHeader.cpp
@@ -130,6 +130,19 @@ void checkIsNullTerminated (const char (&str)[N], const char *what)
 	throw IEX_NAMESPACE::InputExc(s);
 }
 
+void
+sanityCheckDisplayWindow (int width, int height)
+{
+    //
+    // Ensure a valid displayWindow.  All values for which width-1 < 0
+    // are invalid, but in particular, note that if width=-INT_MAX,
+    // width-1 will overflow.
+    //
+    
+    if (width < 1 || height < 1)
+	throw IEX_NAMESPACE::ArgExc ("Invalid display window in image header.");
+}
+
 } // namespace
 
 
@@ -143,6 +156,8 @@ Header::Header (int width,
 :
     _map()
 {
+    sanityCheckDisplayWindow (width, height);
+
     staticInitialize();
 
     Box2i displayWindow (V2i (0, 0), V2i (width - 1, height - 1));
@@ -169,6 +184,8 @@ Header::Header (int width,
 :
     _map()
 {
+    sanityCheckDisplayWindow (width, height);
+
     staticInitialize();
 
     Box2i displayWindow (V2i (0, 0), V2i (width - 1, height - 1));
@@ -896,48 +913,49 @@ Header::sanityCheck (bool isTiled, bool isMultipartFile) const
 
     if (isTiled)
     {
-	if (!hasTileDescription())
-	{
-	    throw IEX_NAMESPACE::ArgExc ("Tiled image has no tile "
-			       "description attribute.");
-	}
+        if (!hasTileDescription())
+        {
+            throw IEX_NAMESPACE::ArgExc ("Tiled image has no tile "
+                        "description attribute.");
+        }
 
-	const TileDescription &tileDesc = tileDescription();
+        const TileDescription &tileDesc = tileDescription();
 
-	if (tileDesc.xSize <= 0 || tileDesc.ySize <= 0 || tileDesc.xSize > INT_MAX || tileDesc.ySize > INT_MAX )
-	    throw IEX_NAMESPACE::ArgExc ("Invalid tile size in image header.");
+        if (tileDesc.xSize <= 0 || tileDesc.ySize <= 0 || tileDesc.xSize > INT_MAX || tileDesc.ySize > INT_MAX )
+            throw IEX_NAMESPACE::ArgExc ("Invalid tile size in image header.");
 
-	if (maxTileWidth > 0 &&
-	    maxTileWidth < int(tileDesc.xSize))
-	{
-	    THROW (IEX_NAMESPACE::ArgExc, "The width of the tiles exceeds the maximum "
-				"width of " << maxTileWidth << "pixels.");
-	}
+        if (maxTileWidth > 0 &&
+            maxTileWidth < int(tileDesc.xSize))
+        {
+            THROW (IEX_NAMESPACE::ArgExc, "The width of the tiles exceeds the maximum "
+                    "width of " << maxTileWidth << "pixels.");
+        }
 
-	if (maxTileHeight > 0 &&
-	    maxTileHeight < int(tileDesc.ySize))
-	{
-	    THROW (IEX_NAMESPACE::ArgExc, "The width of the tiles exceeds the maximum "
-				"width of " << maxTileHeight << "pixels.");
-	}
+        if (maxTileHeight > 0 &&
+            maxTileHeight < int(tileDesc.ySize))
+        {
+            THROW (IEX_NAMESPACE::ArgExc, "The width of the tiles exceeds the maximum "
+                    "width of " << maxTileHeight << "pixels.");
+        }
 
-    // computes size of chunk offset table. Throws an exception if this exceeds
-    // the maximum allowable size
-    getTiledChunkOffsetTableSize(*this);
+        if (tileDesc.mode != ONE_LEVEL &&
+            tileDesc.mode != MIPMAP_LEVELS &&
+            tileDesc.mode != RIPMAP_LEVELS)
+            throw IEX_NAMESPACE::ArgExc ("Invalid level mode in image header.");
 
-	if (tileDesc.mode != ONE_LEVEL &&
-	    tileDesc.mode != MIPMAP_LEVELS &&
-	    tileDesc.mode != RIPMAP_LEVELS)
-	    throw IEX_NAMESPACE::ArgExc ("Invalid level mode in image header.");
+        if (tileDesc.roundingMode != ROUND_UP &&
+            tileDesc.roundingMode != ROUND_DOWN)
+            throw IEX_NAMESPACE::ArgExc ("Invalid level rounding mode in image header.");
+
+        if (lineOrder != INCREASING_Y &&
+            lineOrder != DECREASING_Y &&
+            lineOrder != RANDOM_Y)
+            throw IEX_NAMESPACE::ArgExc ("Invalid line order in image header.");
 
-	if (tileDesc.roundingMode != ROUND_UP &&
-	    tileDesc.roundingMode != ROUND_DOWN)
-	    throw IEX_NAMESPACE::ArgExc ("Invalid level rounding mode in image header.");
+        // computes size of chunk offset table. Throws an exception if this exceeds
+        // the maximum allowable size
+        getTiledChunkOffsetTableSize(*this);
 
-	if (lineOrder != INCREASING_Y &&
-	    lineOrder != DECREASING_Y &&
-	    lineOrder != RANDOM_Y)
-	    throw IEX_NAMESPACE::ArgExc ("Invalid line order in image header.");
     }
     else
     {
diff --git a/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp b/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp
index aebbac7e77bbe003d6e6c1648e99a2d461cd819e..87abc3458eb319bdedee4b07190698151786e8e1 100644
--- a/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp
+++ b/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp
@@ -71,6 +71,19 @@ LineOrderAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is,
 {
     unsigned char tmp;
     Xdr::read <StreamIO> (is, tmp);
+
+    //
+    // prevent invalid values being written to LineOrder enum
+    // by forcing all unknown types to NUM_LINEORDERS which is also an invalid
+    // value but is a legal enum. Note that Header::sanityCheck will
+    // throw an exception when files with invalid lineOrders 
+    //
+    
+    if (tmp != INCREASING_Y &&
+        tmp != DECREASING_Y &&
+        tmp != RANDOM_Y)
+        tmp = NUM_LINEORDERS;
+
     _value = LineOrder (tmp);
 }
 
diff --git a/OpenEXR/IlmImf/ImfMisc.cpp b/OpenEXR/IlmImf/ImfMisc.cpp
index d0b6fb26f678d2ad1ccec0de53b7c443b746a4e2..d2c847877084c93404ad309a6c8e58c3c0cb7ee0 100644
--- a/OpenEXR/IlmImf/ImfMisc.cpp
+++ b/OpenEXR/IlmImf/ImfMisc.cpp
@@ -1448,6 +1448,8 @@ copyFromFrameBuffer (char *& writePtr,
                      Compressor::Format format,
 		     PixelType type)
 {
+    char * localWritePtr = writePtr;
+    const char * localReadPtr = readPtr;
     //
     // Copy a horizontal row of pixels from a frame
     // buffer to an output file's line or tile buffer.
@@ -1463,29 +1465,29 @@ copyFromFrameBuffer (char *& writePtr,
         {
           case OPENEXR_IMF_INTERNAL_NAMESPACE::UINT:
 
-            while (readPtr <= endPtr)
+            while (localReadPtr <= endPtr)
             {
-                Xdr::write <CharPtrIO> (writePtr,
-                                        *(const unsigned int *) readPtr);
-                readPtr += xStride;
+                Xdr::write <CharPtrIO> (localWritePtr,
+                                        *(const unsigned int *) localReadPtr);
+                localReadPtr += xStride;
             }
             break;
 
           case OPENEXR_IMF_INTERNAL_NAMESPACE::HALF:
 
-            while (readPtr <= endPtr)
+            while (localReadPtr <= endPtr)
             {
-                Xdr::write <CharPtrIO> (writePtr, *(const half *) readPtr);
-                readPtr += xStride;
+                Xdr::write <CharPtrIO> (localWritePtr, *(const half *) localReadPtr);
+                localReadPtr += xStride;
             }
             break;
 
           case OPENEXR_IMF_INTERNAL_NAMESPACE::FLOAT:
 
-            while (readPtr <= endPtr)
+            while (localReadPtr <= endPtr)
             {
-                Xdr::write <CharPtrIO> (writePtr, *(const float *) readPtr);
-                readPtr += xStride;
+                Xdr::write <CharPtrIO> (localWritePtr, *(const float *) localReadPtr);
+                localReadPtr += xStride;
             }
             break;
 
@@ -1504,33 +1506,33 @@ copyFromFrameBuffer (char *& writePtr,
         {
           case OPENEXR_IMF_INTERNAL_NAMESPACE::UINT:
 
-            while (readPtr <= endPtr)
+            while (localReadPtr <= endPtr)
             {
                 for (size_t i = 0; i < sizeof (unsigned int); ++i)
-                    *writePtr++ = readPtr[i];
+                    *localWritePtr++ = localReadPtr[i];
 
-                readPtr += xStride;
+                localReadPtr += xStride;
             }
             break;
 
           case OPENEXR_IMF_INTERNAL_NAMESPACE::HALF:
 
-            while (readPtr <= endPtr)
+            while (localReadPtr <= endPtr)
             {
-                *(half *) writePtr = *(const half *) readPtr;
-                writePtr += sizeof (half);
-                readPtr += xStride;
+                *(half *) localWritePtr = *(const half *) localReadPtr;
+                localWritePtr += sizeof (half);
+                localReadPtr += xStride;
             }
             break;
 
           case OPENEXR_IMF_INTERNAL_NAMESPACE::FLOAT:
 
-            while (readPtr <= endPtr)
+            while (localReadPtr <= endPtr)
             {
                 for (size_t i = 0; i < sizeof (float); ++i)
-                    *writePtr++ = readPtr[i];
+                    *localWritePtr++ = localReadPtr[i];
 
-                readPtr += xStride;
+                localReadPtr += xStride;
             }
             break;
             
@@ -1539,6 +1541,9 @@ copyFromFrameBuffer (char *& writePtr,
             throw IEX_NAMESPACE::ArgExc ("Unknown pixel data type.");
         }
     }
+
+    writePtr = localWritePtr;
+    readPtr = localReadPtr;
 }
 
 void
@@ -1881,10 +1886,6 @@ getScanlineChunkOffsetTableSize(const Header& header)
 {
     const Box2i &dataWindow = header.dataWindow();
 
-    vector<size_t> bytesPerLine;
-    size_t maxBytesPerLine = bytesPerLineTable (header,
-                                                bytesPerLine);
-
     int linesInBuffer = numLinesInBuffer ( header.compression() );
 
     int lineOffsetSize = (dataWindow.max.y - dataWindow.min.y +
@@ -1900,18 +1901,30 @@ int
 getTiledChunkOffsetTableSize(const Header& header);
 
 int
-getChunkOffsetTableSize(const Header& header,bool ignore_attribute)
+getChunkOffsetTableSize(const Header& header,bool)
 {
-    if(!ignore_attribute && header.hasChunkCount())
-    {
-        return header.chunkCount();
-    }
-    
+    //
+    // if there is a type in the header which indicates the part is not a currently supported type,
+    // use the chunkCount attribute
+    //
+
+
     if(header.hasType()  && !isSupportedType(header.type()))
     {
-        throw IEX_NAMESPACE::ArgExc ("unsupported header type to "
-        "get chunk offset table size");
+        if(header.hasChunkCount())
+        {
+           return header.chunkCount();
+        }
+        else
+        {
+           throw IEX_NAMESPACE::ArgExc ("unsupported header type to "
+           "get chunk offset table size");
+        }
     }
+
+    //
+    // part is a known type - ignore the header attribute and compute the chunk size from the header
+    //
     if (isTiled(header.type()) == false)
         return getScanlineChunkOffsetTableSize(header);
     else
diff --git a/OpenEXR/IlmImf/ImfMisc.h b/OpenEXR/IlmImf/ImfMisc.h
index 4cb7607e69b3cce0e28389d2cc53887d0d165136..f1cf648abc30eb92839fe344b8d5c16942831b40 100644
--- a/OpenEXR/IlmImf/ImfMisc.h
+++ b/OpenEXR/IlmImf/ImfMisc.h
@@ -464,13 +464,16 @@ bool usesLongNames (const Header &header);
 
 
 //
-// compute size of chunk offset table - if ignore_attribute set to true
-// will compute from the image size and layout, rather than the attribute
-// The default behaviour is to read the attribute
+// compute size of chunk offset table - for existing types, computes
+// the chunk size from the image size, compression type, and tile description
+// (for tiled types). If the type is not supported, uses the chunkCount attribute
+// if present, or throws an exception otherwise
+// deprecated_attribute is no longer used by this function
+//
 //
 
 IMF_EXPORT
-int getChunkOffsetTableSize(const Header& header,bool ignore_attribute=false);
+int getChunkOffsetTableSize(const Header& header,bool deprecated_attribute=false);
 
 OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
 
diff --git a/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp b/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp
index 0c574fa84ce58047abb648df45741ba56476a9ff..1e047269849570b94ce9242501b43e049e7681f0 100644
--- a/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp
+++ b/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp
@@ -451,25 +451,37 @@ MultiPartInputFile::Data::createTileOffsets(const Header& header)
     // Precompute level and tile information
     //
 
-    int* numXTiles;
-    int* numYTiles;
+    int* numXTiles = nullptr;
+    int* numYTiles = nullptr;
     int numXLevels, numYLevels;
     TileDescription tileDesc = header.tileDescription();
-    precalculateTileInfo (tileDesc,
-                          minX, maxX,
-                          minY, maxY,
-                          numXTiles, numYTiles,
-                          numXLevels, numYLevels);
-
-    TileOffsets* tileOffsets = new TileOffsets (tileDesc.mode,
-                                                numXLevels,
-                                                numYLevels,
-                                                numXTiles,
-                                                numYTiles);
-    delete [] numXTiles;
-    delete [] numYTiles;
-
-    return tileOffsets;
+    try
+    {
+
+        precalculateTileInfo (tileDesc,
+                            minX, maxX,
+                            minY, maxY,
+                            numXTiles, numYTiles,
+                            numXLevels, numYLevels);
+
+        TileOffsets* tileOffsets = new TileOffsets (tileDesc.mode,
+                                                    numXLevels,
+                                                    numYLevels,
+                                                    numXTiles,
+                                                    numYTiles);
+        delete [] numXTiles;
+        delete [] numYTiles;
+
+        return tileOffsets;
+
+    }
+    catch(...)
+    {
+        delete [] numXTiles;
+        delete [] numYTiles;
+        throw;
+    }
+
 }
 
 
@@ -626,7 +638,7 @@ MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPA
                     OPENEXR_IMF_INTERNAL_NAMESPACE::Xdr::read <OPENEXR_IMF_INTERNAL_NAMESPACE::StreamIO> (is, packed_sample);
                     
                     //add 40 byte header to packed sizes (tile coordinates, packed sizes, unpacked size)
-                    size_of_chunk=packed_offset+packed_sample+40;
+                    size_of_chunk=packed_offset+packed_sample + 40ll;
                 }
                 else
                 {
@@ -634,7 +646,7 @@ MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPA
                     // regular image has 20 bytes of header, 4 byte chunksize;
                     int chunksize;
                     OPENEXR_IMF_INTERNAL_NAMESPACE::Xdr::read <OPENEXR_IMF_INTERNAL_NAMESPACE::StreamIO> (is, chunksize);
-                    size_of_chunk=chunksize+20;
+                    size_of_chunk=static_cast<Int64>(chunksize) + 20ll;
                 }
             }
             else
@@ -665,13 +677,13 @@ MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPA
                     OPENEXR_IMF_INTERNAL_NAMESPACE::Xdr::read <OPENEXR_IMF_INTERNAL_NAMESPACE::StreamIO> (is, packed_sample);
                     
                     
-                    size_of_chunk=packed_offset+packed_sample+28;
+                    size_of_chunk=packed_offset+packed_sample + 28ll;
                 }
                 else
                 {
                     int chunksize;
                     OPENEXR_IMF_INTERNAL_NAMESPACE::Xdr::read <OPENEXR_IMF_INTERNAL_NAMESPACE::StreamIO> (is, chunksize);   
-                    size_of_chunk=chunksize+8;
+                    size_of_chunk=static_cast<Int64>(chunksize) + 8ll;
                 }
                 
             }
@@ -738,7 +750,7 @@ MultiPartInputFile::Data::readChunkOffsetTables(bool reconstructChunkOffsetTable
 
     for (size_t i = 0; i < parts.size(); i++)
     {
-        int chunkOffsetTableSize = getChunkOffsetTableSize(parts[i]->header,false);
+        int chunkOffsetTableSize = getChunkOffsetTableSize(parts[i]->header);
         parts[i]->chunkOffsets.resize(chunkOffsetTableSize);
 
         for (int j = 0; j < chunkOffsetTableSize; j++)
diff --git a/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp b/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp
index 89501c406803ed422836fd49964b2716e0dbbd4d..082efc276d329a623324d286307f44b12af24a2a 100644
--- a/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp
+++ b/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp
@@ -151,7 +151,7 @@ MultiPartOutputFile::Data::do_header_sanity_checks(bool overrideSharedAttributes
     if (isMultiPart)
     {
         // multipart files must contain a chunkCount attribute
-        _headers[0].setChunkCount(getChunkOffsetTableSize(_headers[0],true));
+        _headers[0].setChunkCount(getChunkOffsetTableSize(_headers[0]));
         
         for (size_t i = 1; i < parts; i++)
         {
@@ -159,7 +159,7 @@ MultiPartOutputFile::Data::do_header_sanity_checks(bool overrideSharedAttributes
                 throw IEX_NAMESPACE::ArgExc ("Every header in a multipart file should have a type");
             
             
-            _headers[i].setChunkCount(getChunkOffsetTableSize(_headers[i],true));
+            _headers[i].setChunkCount(getChunkOffsetTableSize(_headers[i]));
             _headers[i].sanityCheck (_headers[i].hasTileDescription(), isMultiPart);
             
             
@@ -191,7 +191,7 @@ MultiPartOutputFile::Data::do_header_sanity_checks(bool overrideSharedAttributes
         
         if (_headers[0].hasType() && isImage(_headers[0].type()) == false)
         {
-            _headers[0].setChunkCount(getChunkOffsetTableSize(_headers[0],true));
+            _headers[0].setChunkCount(getChunkOffsetTableSize(_headers[0]));
         }
         
     }
@@ -500,7 +500,7 @@ MultiPartOutputFile::Data::writeChunkTableOffsets (vector<OutputPartData*> &part
 {
     for (size_t i = 0; i < parts.size(); i++)
     {
-        int chunkTableSize = getChunkOffsetTableSize(parts[i]->header,false);
+        int chunkTableSize = getChunkOffsetTableSize(parts[i]->header);
 
         Int64 pos = os->tellp();
 
diff --git a/OpenEXR/IlmImf/ImfOpaqueAttribute.h b/OpenEXR/IlmImf/ImfOpaqueAttribute.h
index abea1bc21d43833b2f463ab09dbc70642da8b6f0..82f462fd71f0cd0deb287991cd4d2e70860403d3 100644
--- a/OpenEXR/IlmImf/ImfOpaqueAttribute.h
+++ b/OpenEXR/IlmImf/ImfOpaqueAttribute.h
@@ -105,7 +105,7 @@ class OpaqueAttribute: public Attribute
     virtual void		copyValueFrom (const Attribute &other);
 
 
-    const int                   dataSize() const { return _dataSize; }
+    int                         dataSize() const { return _dataSize; }
     const Array<char>&          data() const { return _data; }
         
   private:
diff --git a/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp b/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp
index 8729f88eaa13c386c7f981a0b6080bd171f2ea2c..42234266828c525ee56f5823ae42f2bf0888793c 100644
--- a/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp
+++ b/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp
@@ -83,6 +83,17 @@ PreviewImageAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &i
     Xdr::read <StreamIO> (is, width);
     Xdr::read <StreamIO> (is, height);
 
+    if (width < 0 || height < 0)
+    {
+        throw IEX_NAMESPACE::InputExc("Invalid dimensions in Preview Image Attribute");
+    }
+
+    // total attribute size should be four bytes per pixel + 8 bytes for width and height dimensions
+    if (static_cast<Int64>(width) * static_cast<Int64>(height) * 4l + 8l != static_cast<Int64>(size) )
+    {
+        throw IEX_NAMESPACE::InputExc("Mismatch between Preview Image Attribute size and dimensions");
+    }
+
     PreviewImage p (width, height);
 
     int numPixels = p.width() * p.height();
diff --git a/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp b/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp
index 88fdf8e8c135a24b4a388f4c475823f78e05d00a..dec1d1fa9d8313396fef4a72d441b8f447eb9b2d 100644
--- a/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp
+++ b/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp
@@ -82,6 +82,13 @@ StringVectorAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &i
        Xdr::read <StreamIO> (is, strSize);
        read += Xdr::size<int>();       
 
+       // check there is enough space remaining in attribute to
+       // contain claimed string length
+       if( strSize < 0 ||  strSize > size - read)
+       {
+           throw IEX_NAMESPACE::InputExc("Invalid size field reading stringvector attribute");
+       }
+
        std::string str;
        str.resize (strSize);
   
diff --git a/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp b/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp
index 18aead598ea19115b98fcb217f947ab65f298516..644813ed841ad41c15f6aac11309a55c6ae41b07 100644
--- a/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp
+++ b/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp
@@ -77,8 +77,29 @@ TileDescriptionAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream
 
     unsigned char tmp;
     Xdr::read <StreamIO> (is, tmp);
-    _value.mode = LevelMode (tmp & 0x0f);
-    _value.roundingMode = LevelRoundingMode ((tmp >> 4) & 0x0f);
+
+    //
+    // four bits are allocated for 'mode' for future use (16 possible values)
+    // but only values 0,1,2 are currently valid. '3' is a special valid enum value
+    // that indicates bad values have been used
+    //
+    // roundingMode can only be 0 or 1, and 2 is a special enum value for 'bad enum'
+    //
+    unsigned char levelMode = tmp & 0x0f;
+    if(levelMode > 3)
+    {
+        levelMode = 3;
+    }
+
+    _value.mode = LevelMode(levelMode);
+
+    unsigned char levelRoundingMode = (tmp >> 4) & 0x0f;
+    if(levelRoundingMode > 2)
+    {
+        levelRoundingMode = 2;
+    }
+
+    _value.roundingMode = LevelRoundingMode (levelRoundingMode);
     
 }
 
diff --git a/OpenEXR/IlmImf/ImfTiledMisc.cpp b/OpenEXR/IlmImf/ImfTiledMisc.cpp
index 8552ada2070f2005265f9b188d54aa311e1025c8..c9e8731f119391b489afcec90b9e5e78b82be2cb 100644
--- a/OpenEXR/IlmImf/ImfTiledMisc.cpp
+++ b/OpenEXR/IlmImf/ImfTiledMisc.cpp
@@ -301,7 +301,11 @@ calculateNumTiles (int *numTiles,
 {
     for (int i = 0; i < numLevels; i++)
     {
-	numTiles[i] = (levelSize (min, max, i, rmode) + size - 1) / size;
+        int l = levelSize (min, max, i, rmode);
+        if (l > std::numeric_limits<int>::max() - size + 1)
+            throw IEX_NAMESPACE::ArgExc ("Invalid size.");
+
+        numTiles[i] = (l + size - 1) / size;
     }
 }
 
@@ -348,23 +352,23 @@ getTiledChunkOffsetTableSize(const Header& header)
     // Precompute level and tile information.
     //
 
-    int* numXTiles;
-    int* numYTiles;
+    int* numXTiles=nullptr;
+    int* numYTiles=nullptr;
     int numXLevels;
     int numYLevels;
-    precalculateTileInfo (header.tileDescription(),
-                          dataWindow.min.x, dataWindow.max.x,
-                          dataWindow.min.y, dataWindow.max.y,
-                          numXTiles, numYTiles,
-                          numXLevels, numYLevels);
-
-    //
-    // Calculate lineOffsetSize.
-    //
-    Int64 lineOffsetSize = 0;
-    const TileDescription &desc = header.tileDescription();
     try
     {
+        precalculateTileInfo (header.tileDescription(),
+                            dataWindow.min.x, dataWindow.max.x,
+                            dataWindow.min.y, dataWindow.max.y,
+                            numXTiles, numYTiles,
+                            numXLevels, numYLevels);
+
+        //
+        // Calculate lineOffsetSize.
+        //
+        Int64 lineOffsetSize = 0;
+        const TileDescription &desc = header.tileDescription();
         switch (desc.mode)
         {
             case ONE_LEVEL:
diff --git a/OpenEXR/IlmImf/ImfXdr.h b/OpenEXR/IlmImf/ImfXdr.h
index 0af6f67b521e88a3d1387e3fd523188b50cfd62e..0c91d723a906421bdac7949e18757061b399b435 100644
--- a/OpenEXR/IlmImf/ImfXdr.h
+++ b/OpenEXR/IlmImf/ImfXdr.h
@@ -649,8 +649,8 @@ read (T &in, signed short &v)
 
     readSignedChars<S> (in, b, 2);
 
-    v = (b[0] & 0x00ff) |
-	(b[1] << 8);
+    v = (static_cast <unsigned char> (b[0]) & 0x00ff) |
+	(static_cast <unsigned char> (b[1]) << 8);
 }
 
 
@@ -675,10 +675,10 @@ read (T &in, signed int &v)
 
     readSignedChars<S> (in, b, 4);
 
-    v =  (b[0]        & 0x000000ff) |
-	((b[1] << 8)  & 0x0000ff00) |
-	((b[2] << 16) & 0x00ff0000) |
-	 (b[3] << 24);
+    v =  (static_cast <unsigned char> (b[0])        & 0x000000ff) |
+	((static_cast <unsigned char> (b[1]) << 8)  & 0x0000ff00) |
+	((static_cast <unsigned char> (b[2]) << 16) & 0x00ff0000) |
+         (static_cast <unsigned char> (b[3]) << 24);
 }
 
 
@@ -707,10 +707,10 @@ read (T &in, signed long &v)
 
     #if LONG_MAX == 2147483647
 
-	v =  (b[0]        & 0x000000ff) |
-	    ((b[1] << 8)  & 0x0000ff00) |
-	    ((b[2] << 16) & 0x00ff0000) |
-	     (b[3] << 24);
+        v =  (static_cast <unsigned long> (b[0])        & 0x000000ff) |
+            ((static_cast <unsigned long> (b[1]) << 8)  & 0x0000ff00) |
+            ((static_cast <unsigned long> (b[2]) << 16) & 0x00ff0000) |
+             (static_cast <unsigned long> (b[3]) << 24);
 
 	if (( b[4] ||  b[5] ||  b[6] ||  b[7]) &&
 	    (~b[4] || ~b[5] || ~b[6] || ~b[7]))
@@ -721,14 +721,14 @@ read (T &in, signed long &v)
 
     #elif LONG_MAX == 9223372036854775807L
 
-	v =  ((long) b[0]        & 0x00000000000000ff) |
-	    (((long) b[1] << 8)  & 0x000000000000ff00) |
-	    (((long) b[2] << 16) & 0x0000000000ff0000) |
-	    (((long) b[3] << 24) & 0x00000000ff000000) |
-	    (((long) b[4] << 32) & 0x000000ff00000000) |
-	    (((long) b[5] << 40) & 0x0000ff0000000000) |
-	    (((long) b[6] << 48) & 0x00ff000000000000) |
-	     ((long) b[7] << 56);
+	v =  (static_cast <unsigned long> (b[0])        & 0x00000000000000ff) |
+	    ((static_cast <unsigned long> (b[1]) << 8)  & 0x000000000000ff00) |
+	    ((static_cast <unsigned long> (b[2]) << 16) & 0x0000000000ff0000) |
+	    ((static_cast <unsigned long> (b[3]) << 24) & 0x00000000ff000000) |
+	    ((static_cast <unsigned long> (b[4]) << 32) & 0x000000ff00000000) |
+	    ((static_cast <unsigned long> (b[5]) << 40) & 0x0000ff0000000000) |
+	    ((static_cast <unsigned long> (b[6]) << 48) & 0x00ff000000000000) |
+             (static_cast <unsigned long> (b[7]) << 56);
 
     #else
 
diff --git a/OpenEXR/IlmImfExamples/.cvsignore b/OpenEXR/IlmImfExamples/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/IlmImfExamples/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR/IlmImfFuzzTest/main.cpp b/OpenEXR/IlmImfFuzzTest/main.cpp
index 19ad55efc281773de93760b34480a0b7da5a3502..359c45bdc3e341a76f9414377e7e9e8e6ade2cf4 100644
--- a/OpenEXR/IlmImfFuzzTest/main.cpp
+++ b/OpenEXR/IlmImfFuzzTest/main.cpp
@@ -61,18 +61,39 @@ using std::string;
 using std::cout;
 using std::endl;
 
-#define TEST(x) if (helpMode) tests.insert(string(#x)); else if (argc < 2 || !strcmp (argv[1], #x)) x(argc==3 ? argv[2] : nullptr);
+#define TEST(x)                                 \
+    if (helpMode)                               \
+    {                                           \
+        tests.insert(string(#x));               \
+    }                                           \
+    else if (argc < 2 || !strcmp (argv[1], #x)) \
+    {                                           \
+        testFound = true;                       \
+        x(argc==3 ? argv[2] : nullptr);         \
+    }
 
 int
 main (int argc, char *argv[])
 {
     bool helpMode = false;
+    bool testFound = false;
+    
     if( argc==2 && (strcmp(argv[1],"--help")==0 || strcmp(argv[1],"-h")==0))
     {
 	    helpMode = true;
     }
     set<string> tests;
 
+    //
+    // If there's a second argument, it's a test file, so make sure it
+    // exists.
+    //
+    
+    if (argc == 3 && access (argv[2], R_OK) != 0)
+    {
+        std::cout << "No such file: " << argv[2] << endl;
+        exit (-1);
+    }
 
     TEST (testFuzzScanLines);
     TEST (testFuzzTiles);
@@ -106,21 +127,24 @@ main (int argc, char *argv[])
        }
 
     }
+    else if (!testFound)
+    {
+        cout << "No such test: " << argv[1] << endl;
+    }
     else
     {
-
 #ifdef OPENEXR_IMF_HAVE_LINUX_PROCFS
 
-    //
-    // Allow the user to check for file descriptor leaks
-    //
-
-    cout << "open file descriptors:" << endl;
+        //
+        // Allow the user to check for file descriptor leaks
+        //
 
-    std::stringstream ss;
-    ss << "ls -lG /proc/" << getpid() << "/fd";
+        cout << "open file descriptors:" << endl;
 
-    system (ss.str().c_str());
+        std::stringstream ss;
+        ss << "ls -lG /proc/" << getpid() << "/fd";
+        
+        system (ss.str().c_str());
 #endif
     }
     return 0;
diff --git a/OpenEXR/IlmImfTest/.cvsignore b/OpenEXR/IlmImfTest/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/IlmImfTest/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR/config/CMakeLists.txt b/OpenEXR/config/CMakeLists.txt
index b52ad0d556c2cf0dc1d169d0819d07ccf630b42f..6e14e10b66e96fcacb5230f7e142b66023aab467 100644
--- a/OpenEXR/config/CMakeLists.txt
+++ b/OpenEXR/config/CMakeLists.txt
@@ -47,6 +47,9 @@ set(OPENEXR_IMF_HAVE_COMPLETE_IOMANIP TRUE)
 
 if(APPLE)
   set(OPENEXR_IMF_HAVE_DARWIN TRUE)
+  if (${CMAKE_OSX_ARCHITECTURES} MATCHES arm64)
+    set(OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX FALSE)
+  endif()
 endif()
 
 configure_file(OpenEXRConfig.h.in_cmake ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h)
diff --git a/OpenEXR/configure.ac b/OpenEXR/configure.ac
index a93b88d1a1c3f610bedb87e211df06d48b0cc16f..225e115588703ef08ef9b472559f6495f3567b32 100644
--- a/OpenEXR/configure.ac
+++ b/OpenEXR/configure.ac
@@ -5,12 +5,12 @@ dnl
 
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(OpenEXR, 2.5.2)
+AC_INIT(OpenEXR, 2.5.3)
 AC_CONFIG_MACRO_DIR([m4])
 
 AC_SUBST(OPENEXR_VERSION_MAJOR, 2)
 AC_SUBST(OPENEXR_VERSION_MINOR, 5)
-AC_SUBST(OPENEXR_VERSION_PATCH, 2)
+AC_SUBST(OPENEXR_VERSION_PATCH, 3)
 
 AC_SUBST(OPENEXR_VERSION, ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH})
 AC_SUBST(OPENEXR_VERSION_API, ${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})
@@ -24,7 +24,7 @@ AM_MAINTAINER_MODE
 
 
 LIBTOOL_CURRENT=25
-LIBTOOL_REVISION=1
+LIBTOOL_REVISION=2
 LIBTOOL_AGE=0
 LIBTOOL_VERSION=$LIBTOOL_CURRENT:$LIBTOOL_REVISION:$LIBTOOL_AGE
 AC_SUBST(LIBTOOL_VERSION)
diff --git a/OpenEXR/doc/.cvsignore b/OpenEXR/doc/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/doc/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR/exrenvmap/.cvsignore b/OpenEXR/exrenvmap/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/exrenvmap/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR/exrheader/.cvsignore b/OpenEXR/exrheader/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/exrheader/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR/exrmakepreview/.cvsignore b/OpenEXR/exrmakepreview/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/exrmakepreview/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR/exrmaketiled/.cvsignore b/OpenEXR/exrmaketiled/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/exrmaketiled/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR/exrstdattr/.cvsignore b/OpenEXR/exrstdattr/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR/exrstdattr/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR_Viewers/.cvsignore b/OpenEXR_Viewers/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR_Viewers/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR_Viewers/doc/.cvsignore b/OpenEXR_Viewers/doc/.cvsignore
deleted file mode 100644
index ac724606c6c3cdc420740434b6848d8dd0ae41e2..0000000000000000000000000000000000000000
--- a/OpenEXR_Viewers/doc/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
diff --git a/OpenEXR_Viewers/exrdisplay/.cvsignore b/OpenEXR_Viewers/exrdisplay/.cvsignore
deleted file mode 100644
index dbd02a06b9980bca0fccf612d203efd11c2f0aaf..0000000000000000000000000000000000000000
--- a/OpenEXR_Viewers/exrdisplay/.cvsignore
+++ /dev/null
@@ -1,17 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
-CVS
diff --git a/OpenEXR_Viewers/playexr/.cvsignore b/OpenEXR_Viewers/playexr/.cvsignore
deleted file mode 100644
index dbd02a06b9980bca0fccf612d203efd11c2f0aaf..0000000000000000000000000000000000000000
--- a/OpenEXR_Viewers/playexr/.cvsignore
+++ /dev/null
@@ -1,17 +0,0 @@
-Makefile
-Makefile.in
-config.h.in
-config.h
-config.log
-config.status
-configure
-libtool
-stamp-h
-aclocal.m4
-OpenEXR.pc
-autom4te.cache
-ltmain.sh
-stamp-h.in
-depcomp
-.deps
-CVS
diff --git a/PyIlmBase/configure.ac b/PyIlmBase/configure.ac
index 28a6a02eeeb04ac78cd821174f847243269063ef..5491a91c4c10c3cf05210b3fb914790d5329e817 100644
--- a/PyIlmBase/configure.ac
+++ b/PyIlmBase/configure.ac
@@ -4,8 +4,8 @@ dnl Copyright Contributors to the OpenEXR Project.
 dnl
 
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(PyIlmBase, 2.5.2)
-AC_SUBST(PYILMBASE_VERSION, 2.5.2)
+AC_INIT(PyIlmBase, 2.5.3)
+AC_SUBST(PYILMBASE_VERSION, 2.5.3)
 AC_CANONICAL_HOST
 AC_CONFIG_SRCDIR(PyIex/iexmodule.cpp)
 AC_CONFIG_HEADERS([config/PyIlmBaseConfig.h])
@@ -17,7 +17,7 @@ AC_DISABLE_STATIC
 
 
 LIBTOOL_CURRENT=25
-LIBTOOL_REVISION=1
+LIBTOOL_REVISION=2
 LIBTOOL_AGE=0
 LIBTOOL_VERSION=$LIBTOOL_CURRENT:$LIBTOOL_REVISION:$LIBTOOL_AGE
 AC_SUBST(LIBTOOL_VERSION)
diff --git a/README.md b/README.md
index 521f0f138e2c3eee2540d2fed196686633ab79e1..00a7945dc194cd12294806916435621529f02772 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 [![License](https://img.shields.io/github/license/AcademySoftwareFoundation/openexr)](LICENSE.md)
 [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2799/badge)](https://bestpractices.coreinfrastructure.org/projects/2799)
-[![Build Status](https://github.com/AcademySoftwareFoundation/openexr/workflows/CI/badge.svg)](https://github.com/AcademySoftwareFoundation/openexr/workflows/CI/badge.svg)
-[![Analysis Status](https://github.com/AcademySoftwareFoundation/openexr/workflows/Analysis/badge.svg)](https://github.com/AcademySoftwareFoundation/openexr/workflows/Analysis/badge.svg)
+[![Build Status](https://github.com/AcademySoftwareFoundation/openexr/workflows/CI/badge.svg)](https://github.com/AcademySoftwareFoundation/openexr/actions?query=workflow%3ACI)
+[![Analysis Status](https://github.com/AcademySoftwareFoundation/openexr/workflows/Analysis/badge.svg)](https://github.com/AcademySoftwareFoundation/openexr/actions?query=workflow%3AAnalysis)
 [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=AcademySoftwareFoundation_openexr&metric=alert_status)](https://sonarcloud.io/dashboard?id=AcademySoftwareFoundation_openexr)
 
 # OpenEXR
@@ -113,7 +113,7 @@ from source.
 
 ## Resources
 
-* Website: http:://www.openexr.com
+* Website: http://www.openexr.com
 
 * GitHub repository: http://www.github.com/AcademySoftwareFoundation/openexr
 
diff --git a/SECURITY.md b/SECURITY.md
index 2d73ade886065915748ba0dd4ce64d3a6d8c08d4..faeb18a290089d4dfe61fea5d7d70192483e076e 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -16,6 +16,9 @@ post patches as quickly as possible.
 
 These vulnerabilities are present in the given versions:
 
+* [CVE-2020-15306](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15306) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1 
+* [CVE-2020-15305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15305) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1 
+* [CVE-2020-15304](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15304) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1 
 * [CVE-2020-11765](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11765) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0 
 * [CVE-2020-11764](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11764) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0 
 * [CVE-2020-11763](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11763) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0