Add fast, memory-safe PNG and GIF decoding to a C or C++ project by dropping in the pre-generated Wuffs C source file.
Replace a potentially vulnerable image-parsing library in a security-sensitive application with one that cannot overflow or access memory out-of-bounds.
Process untrusted uploaded image files in a server without risk of memory-safety exploits from malformed or malicious inputs.
Decode images faster than libpng in a performance-critical application such as a browser, game engine, or image processing pipeline.
Using the library only requires including a single pre-generated C file, modifying or extending Wuffs requires learning its annotation-heavy language and toolchain.
Wuffs is a programming language and standard library built specifically for reading and writing file formats safely and quickly. Its name stands for Wrangling Untrusted File Formats Safely. It handles images, audio, video, fonts, and compressed archives. The central problem Wuffs solves is that many security vulnerabilities come from processing files written by strangers. A malformed image file, for example, can crash or exploit a program that reads it carelessly. Wuffs addresses this by checking for overflow errors, out-of-bounds memory access, and similar bugs at compile time rather than at runtime. If the code compiles, those three categories of bugs cannot occur. Wuffs achieves speed by stripping away everything that is not pure computation. The language cannot make system calls, cannot read files directly, and cannot allocate or free memory on its own. It only transforms bytes in one form to bytes in another form. This narrow focus lets it run faster than widely used C libraries for the same tasks: the benchmarks show it decoding PNG 1.2 to 2.7 times faster than established alternatives, and GIF 2 to 6 times faster. Developers who want to use Wuffs do not need to learn the Wuffs language. The library ships as pre-generated C code that any C or C++ project can include like any other third-party library. The Wuffs language and its toolchain are only needed by people who want to modify or extend the library itself. The trade-off is that writing Wuffs code takes more effort than writing ordinary C. Programmers must add annotations that prove to the compiler that no overflow can happen, which slows authoring but guarantees correctness.
← google on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.