media/libpng/1737038.patch
author Cosmin Sabou <csabou@mozilla.com>
Sun, 05 Feb 2023 19:37:33 +0000
changeset 651812 d8601249f1eb8c52c742b0c19c9ca0fa8f2e31fe
parent 606131 f116ee4a85bf44c14077dc906adaf4379c6d947b
permissions -rw-r--r--
Bug 1806090 - temporarily disable browser_quickactions.js on linux for frequent failures. r=intermittent-reviewers,MasterWayZ Differential Revision: https://phabricator.services.mozilla.com/D168909

diff --git a/pngwutil.c b/pngwutil.c
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -336,8 +336,10 @@ png_deflate_claim(png_structrp png_ptr,
          if ((png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY) != 0)
             strategy = png_ptr->zlib_strategy;
 
+#ifdef PNG_WRITE_FILTER_SUPPORTED
          else if (png_ptr->do_filter != PNG_FILTER_NONE)
             strategy = PNG_Z_DEFAULT_STRATEGY;
+#endif
 
          else
             strategy = PNG_Z_DEFAULT_NOFILTER_STRATEGY;
@@ -828,12 +830,16 @@ png_write_IHDR(png_structrp png_ptr, png
 
    if ((png_ptr->do_filter) == PNG_NO_FILTERS)
    {
+#ifdef PNG_WRITE_FILTER_SUPPORTED
       if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||
           png_ptr->bit_depth < 8)
          png_ptr->do_filter = PNG_FILTER_NONE;
 
       else
          png_ptr->do_filter = PNG_ALL_FILTERS;
+#else
+      png_ptr->do_filter = PNG_FILTER_NONE;
+#endif
    }
 
    png_ptr->mode = PNG_HAVE_IHDR; /* not READY_FOR_ZTXT */