File libraw-CVE-2020-22628.patch of Package libraw.30665

Index: LibRaw-0.15.4/internal/dcraw_common.cpp
===================================================================
--- LibRaw-0.15.4.orig/internal/dcraw_common.cpp
+++ LibRaw-0.15.4/internal/dcraw_common.cpp
@@ -9114,6 +9114,10 @@ c603:
    order = 0x4949;
    maximum = 0x0fff;
   }
+
+  /* Early reject for damaged images */
+  if(raw_width < 22 || raw_width > 64000 || raw_height < 22 || raw_width > 64000 || pixel_aspect < 0.1 || pixel_aspect > 10)
+    is_raw = 0;
 }
 
 
openSUSE Build Service is sponsored by