1. 06 Nov, 2021 2 commits
  2. 01 Nov, 2021 1 commit
  3. 26 Oct, 2021 1 commit
  4. 01 Oct, 2021 1 commit
  5. 02 Jul, 2021 1 commit
  6. 01 Jul, 2021 1 commit
    • Uli Schlachter's avatar
      ~CairoOutputDev(): Free textClipPath · 571d8138
      Uli Schlachter authored
      The textClipPath member is set in CairoOutputDev::endString() and freed
      in CairoOutputDev::endTextObject(). However, if endTextObject() is not
      called for whatever reason, the path will just be leaked.
      
      This adds code to the destructor to free this.
      
      This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32326
      
      Testing done:
      
      $ wget -O testcase 'https://oss-fuzz.com/download?testcase_id=6659952325296128'
      [...]
      $ cmake .. -G Ninja -DENABLE_DCTDECODER=unmaintained -DENABLE_BOOST=OFF -DENABLE_LIBOPENJPEG=unmaintained && ninja
      [...]
      $ git describe
      poppler-21.06.1-5-gb7c40059
      $ valgrind --leak-check=full ./utils/pdftocairo testcase -png foo
      [...]
      ==104075==
      ==104075== HEAP SUMMARY:
      ==104075==     in use at exit: 28,292 bytes in 55 blocks
      ==104075==   total heap usage: 6,114 allocs, 6,059 frees, 1,617,444 bytes allocated
      ==104075==
      ==104075== 24 bytes in 1 blocks are definitely lost in loss record 4 of 37
      ==104075==    at 0x483877F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==104075==    by 0x48AE748: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11600.0)
      ==104075==    by 0x118995: endString (CairoOutputDev.cc:1474)
      ==104075==    by 0x118995: CairoOutputDev::endString(GfxState*) (CairoOutputDev.cc:1412)
      ==104075==    by 0x4B97295: Gfx::doShowText(GooString const*) (Gfx.cc:4010)
      ==104075==    by 0x4B97CB4: Gfx::opShowSpaceText(Object*, int) (Gfx.cc:3793)
      ==104075==    by 0x4B8D866: Gfx::go(bool) (Gfx.cc:681)
      ==104075==    by 0x4B8DCFA: display (Gfx.cc:642)
      ==104075==    by 0x4B8DCFA: Gfx::display(Object*, bool) (Gfx.cc:622)
      ==104075==    by 0x4BE1A83: Page::displaySlice(OutputDev*, double, double, int, bool, bool, int, int, int, int, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, bool) (Page.cc:576)
      ==104075==    by 0x11317C: renderPage (pdftocairo.cc:669)
      ==104075==    by 0x11317C: main (pdftocairo.cc:1183)
      ==104075==
      ==104075== LEAK SUMMARY:
      ==104075==    definitely lost: 24 bytes in 1 blocks
      ==104075==    indirectly lost: 0 bytes in 0 blocks
      ==104075==      possibly lost: 0 bytes in 0 blocks
      ==104075==    still reachable: 28,268 bytes in 54 blocks
      ==104075==         suppressed: 0 bytes in 0 blocks
      ==104075== Reachable blocks (those to which a pointer was found) are not shown.
      ==104075== To see them, rerun with: --leak-check=full --show-leak-kinds=all
      ==104075==
      ==104075== For lists of detected and suppressed errors, rerun with: -s
      ==104075== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
      $ git checkout cairo-leak-textClipPath && git describe && ninja
      Zu Branch 'cairo-leak-textClipPath' gewechselt
      poppler-21.06.1-6-g8df6f8d2
      
      
      $ valgrind --leak-check=full ./utils/pdftocairo testcase -png foo
      [...]
      ==104263==
      ==104263== HEAP SUMMARY:
      ==104263==     in use at exit: 28,268 bytes in 54 blocks
      ==104263==   total heap usage: 6,114 allocs, 6,060 frees, 1,617,444 bytes allocated
      ==104263==
      ==104263== LEAK SUMMARY:
      ==104263==    definitely lost: 0 bytes in 0 blocks
      ==104263==    indirectly lost: 0 bytes in 0 blocks
      ==104263==      possibly lost: 0 bytes in 0 blocks
      ==104263==    still reachable: 28,268 bytes in 54 blocks
      ==104263==         suppressed: 0 bytes in 0 blocks
      ==104263== Reachable blocks (those to which a pointer was found) are not shown.
      ==104263== To see them, rerun with: --leak-check=full --show-leak-kinds=all
      ==104263==
      ==104263== For lists of detected and suppressed errors, rerun with: -s
      ==104263== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
      
      As you (might) see, before this commit, there is a "definitely lost"
      leak of 24 bytes with this test case. After this commit, this leak is
      gone.
      Signed-off-by: Uli Schlachter's avatarUli Schlachter <psychon@znc.in>
      571d8138
  7. 07 Feb, 2021 1 commit
  8. 29 Oct, 2020 1 commit
  9. 03 Jul, 2020 1 commit
    • Albert Astals Cid's avatar
      Run clang-format · 814fbda2
      Albert Astals Cid authored
      find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format -i {} \;
      
      If you reached this file doing a git blame, please see README.contributors (instructions added 2 commits in the future to this one)
      814fbda2
  10. 13 May, 2020 1 commit
  11. 12 May, 2020 1 commit
  12. 11 May, 2020 2 commits
  13. 04 Jan, 2020 3 commits
  14. 02 Dec, 2019 1 commit
  15. 29 Nov, 2019 1 commit
  16. 23 Nov, 2019 1 commit
  17. 20 Oct, 2019 1 commit
  18. 27 Sep, 2019 1 commit
  19. 22 Sep, 2019 1 commit
  20. 20 Sep, 2019 1 commit
  21. 21 Jun, 2019 2 commits
  22. 06 Feb, 2019 2 commits
    • Albert Astals Cid's avatar
      Update (C) of last commit · 2c5fadd7
      Albert Astals Cid authored
      2c5fadd7
    • Albert Astals Cid's avatar
      Use reinterpret_cast to silence cast-align warnings · 5a72f3cd
      Albert Astals Cid authored
      In ImageOutputDev it comes directly from malloc, and malloc guarantees
      alignment for basic types, so we're good
      
      In ArthurOutputDev it comes from QImage::bits that uses malloc
      internally, so we're good
      
      In cairo* it comes from cairo_image_surface_get_data that comes from
      pixman_image_get_data that returns a uint32_t * so we're only going to
      the original type alignment
      5a72f3cd
  23. 20 Dec, 2018 1 commit
  24. 06 Dec, 2018 1 commit
  25. 11 Nov, 2018 1 commit
  26. 01 Nov, 2018 3 commits
  27. 23 Oct, 2018 1 commit
  28. 21 Oct, 2018 1 commit
  29. 10 Oct, 2018 1 commit
    • Adam Reichold's avatar
      Remove usage of pragmas interface and implementation · 7f20ace4
      Adam Reichold authored
      GCC recommends not using them for a long time and its documentation says:
      > These #pragmas have been superceded as of GCC 2.7.2 by COMDAT support
      > and the “key method” heuristic mentioned in Vague Linkage.
      > Using them can actually cause your program to grow due to
      > unnecessary out-of-line copies of inline functions.
      
      Also nobody seems to set USE_GCC_PRAGMAS and sometimes they were
      guarded by just __GNUC__ which upsets Clang.
      7f20ace4
  30. 09 Oct, 2018 1 commit
  31. 23 Sep, 2018 1 commit
    • Albert Astals Cid's avatar
      More const · b8b82412
      Albert Astals Cid authored
      Marked some caches as mutable
      
      Fixed an actual bug in page::text that was swapping the page cropbox in
      each call
      b8b82412
  32. 22 Jun, 2018 1 commit