freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fuzzing SDFs


From: Anuj Verma
Subject: Re: fuzzing SDFs
Date: Sat, 31 Jul 2021 15:55:35 +0530


> Anuj, there is a lot of documentation in form of READMEs in this repository to hopefully give you a
> high-level idea of how this thing is kind of put together.  I reckon, a good entry point to probably this
> script:  https://github.com/freetype/freetype2-testing/blob/master/fuzzing/scripts/custom-build.sh;
> just run it and it will prompt you for details :)

Thanks!, I did check it out and I think simply adding the new render modes to the render mode
list should be sufficient. The first line (`{ FT_LOAD_NO_BITMAP | FT_LOAD_TARGET_NORMAL, FT_RENDER_MODE_SDF }`)
is to use the `sdf` module for rendering and the second (`{ FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL, FT_RENDER_MODE_SDF }`)
is to invoke the `bsdf` module since it requires bitmap input. Please check it out, if there are other
things required please let me know, I'm attaching the diff below.

diff --git a/fuzzing/src/visitors/facevisitor-renderglyphs.cpp b/fuzzing/src/visitors/facevisitor-renderglyphs.cpp
index abcfb2a..c1871a0 100644
--- a/fuzzing/src/visitors/facevisitor-renderglyphs.cpp
+++ b/fuzzing/src/visitors/facevisitor-renderglyphs.cpp
@@ -27,7 +27,9 @@
     { FT_LOAD_NO_BITMAP | FT_LOAD_TARGET_LIGHT,  FT_RENDER_MODE_LIGHT  },
     { FT_LOAD_NO_BITMAP | FT_LOAD_TARGET_MONO,   FT_RENDER_MODE_MONO   },
     { FT_LOAD_NO_BITMAP | FT_LOAD_TARGET_LCD,    FT_RENDER_MODE_LCD    },
-    { FT_LOAD_NO_BITMAP | FT_LOAD_TARGET_LCD_V,  FT_RENDER_MODE_LCD_V  }
+    { FT_LOAD_NO_BITMAP | FT_LOAD_TARGET_LCD_V,  FT_RENDER_MODE_LCD_V  },
+    { FT_LOAD_NO_BITMAP | FT_LOAD_TARGET_NORMAL, FT_RENDER_MODE_SDF    },
+    { FT_LOAD_RENDER    | FT_LOAD_TARGET_NORMAL, FT_RENDER_MODE_SDF    }
   };

Thanks,
Anuj

reply via email to

[Prev in Thread] Current Thread [Next in Thread]