File openexr-CVE-2020-16588.patch of Package openexr.17686

Index: openexr-2.2.1/exrmakepreview/makePreview.cpp
===================================================================
--- openexr-2.2.1.orig/exrmakepreview/makePreview.cpp	2020-12-16 10:20:11.324983868 +0100
+++ openexr-2.2.1/exrmakepreview/makePreview.cpp	2020-12-16 10:20:45.913193786 +0100
@@ -123,8 +123,8 @@ generatePreview (const char inFileName[]
     previewHeight = max (int (h / (w * a) * previewWidth + .5f), 1);
     previewPixels.resizeErase (previewHeight, previewWidth);
 
-    double fx = (previewWidth  > 0)? (double (w - 1) / (previewWidth  - 1)): 1;
-    double fy = (previewHeight > 0)? (double (h - 1) / (previewHeight - 1)): 1;
+    double fx = (previewWidth  > 1)? (double (w - 1) / (previewWidth  - 1)): 1;
+    double fy = (previewHeight > 1)? (double (h - 1) / (previewHeight - 1)): 1;
     float m  = Math<float>::pow (2.f, clamp (exposure + 2.47393f, -20.f, 20.f));
 
     for (int y = 0; y < previewHeight; ++y)
openSUSE Build Service is sponsored by