From b8890277ba53fdf7b61a580a9495c8c0fcc41c3d Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Tue, 24 Feb 2026 19:15:41 +0100 Subject: [PATCH] [gfx] Use gzip stream total_out for SVG document parsing. With this change, the assert is no longer necessary, because the stream tells us how many elements to process. --- gfx/thebes/gfxSVGGlyphs.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gfx/thebes/gfxSVGGlyphs.cpp b/gfx/thebes/gfxSVGGlyphs.cpp index 13c0420cc2..3477b34441 100644 --- a/gfx/thebes/gfxSVGGlyphs.cpp +++ b/gfx/thebes/gfxSVGGlyphs.cpp @@ -311,8 +311,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"); }