Verified Commit 74fb0090 authored by Brad Werth's avatar Brad Werth Committed by ma1
Browse files

Bug 2006199: Use gzip stream total_out for SVG document parsing. r=jfkthame

With this change, the assert is no longer necessary, because the stream
tells us how many elements to process. A crashtest is included.

Differential Revision: https://phabricator.services.mozilla.com/D276726
parent 85ae071e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<style>
@font-face {
    font-family: 'PoCFont';
    src: url('badsvgfont.ttf');
}
</style>
<div style="font-family: PoCFont; font-size: 100px;">L</div>
+66.7 KiB

File added.

No diff preview for this file type.

+1 −0
Original line number Diff line number Diff line
@@ -226,3 +226,4 @@ load 1683679.html
load 1843622.html
load 1898569.html
load 1938548.html
load 2006199.html
+1 −2
Original line number Diff line number Diff line
@@ -282,8 +282,7 @@ gfxSVGGlyphsDocument::gfxSVGGlyphsDocument(const uint8_t* aBuffer,
      if (Z_OK == inflateInit2(&s, 16 + MAX_WBITS)) {
        int result = inflate(&s, Z_FINISH);
        if (Z_STREAM_END == result) {
          MOZ_ASSERT(size_t(s.next_out - outBuf.Elements()) == origLen);
          ParseDocument(outBuf.Elements(), outBuf.Length());
          ParseDocument(outBuf.Elements(), s.total_out);
        } else {
          NS_WARNING("Failed to decompress SVG glyphs document");
        }