poppler issueshttps://gitlab.freedesktop.org/poppler/poppler/-/issues2022-10-10T16:43:18Zhttps://gitlab.freedesktop.org/poppler/poppler/-/issues/1296pdftocairo unable to convert PDFs containing highlights to svg2022-10-10T16:43:18ZHelen Zhangpdftocairo unable to convert PDFs containing highlights to svg`pdftocairo -svg` output is blank for PDF pages containing highlights.
I've attached two sample PDFs and the output of `pdftocairo -svg` for the first page of document. The default document works as expected, but the one with text high...`pdftocairo -svg` output is blank for PDF pages containing highlights.
I've attached two sample PDFs and the output of `pdftocairo -svg` for the first page of document. The default document works as expected, but the one with text highlighted didn't work.
[default.pdf](/uploads/39e21524b06fbf7ec83f065f738e89f4/default.pdf)
![default.svg](/uploads/de1557005d675145d0c63282a53b3129/default.svg)
[highlights.pdf](/uploads/4584416ae962468f4df6a3e835362a33/highlights.pdf)
![highlights.svg](/uploads/703628528abebe3c7c8bec8f8b551f0a/highlights.svg)
The pdftocairo version I am using is 22.08.0.https://gitlab.freedesktop.org/poppler/poppler/-/issues/1295pdftotext on page width/height mismatch with the content coordinates on rotat...2022-09-28T04:05:37ZJeffrey Kepdftotext on page width/height mismatch with the content coordinates on rotated pagesFirst of all, thank you for creating poppler, it's awesome. We've been utilizing poppler for extracting text from PDFs.
There is a small thing (not 100% if it is a bug) that I would like to draw it to your attention. In **pdftotext**, wh...First of all, thank you for creating poppler, it's awesome. We've been utilizing poppler for extracting text from PDFs.
There is a small thing (not 100% if it is a bug) that I would like to draw it to your attention. In **pdftotext**, when processing a **rotated page**, the page width and height seems to be mismatching with the content coordinates (i.e., block, line, word). This behavior has been in pdftotext for many years, is this indented? Or should it be altered? I've provided our customisation below for your reference.
The following block is an example. You can see the height is 617, but the yMax is above 617.
```
<page width="831.606000" height="617.569000">
<flow>
<block xMin="39.594500" yMin="103.476200" xMax="208.965220" yMax="756.526200">
<line xMin="49.654500" yMin="103.476200" xMax="208.328117" yMax="112.116200">
<word xMin="49.654500" yMin="103.476200" xMax="60.796260" yMax="112.116200">St.</word>
<word xMin="69.219300" yMin="103.476200" xMax="91.915620" yMax="112.116200">Luke,</word>
<word xMin="100.354500" yMin="103.476200" xMax="121.380010" yMax="112.116200">after</word>
<word xMin="129.754500" yMin="103.476200" xMax="152.905860" yMax="112.116200">being</word>
<word xMin="161.164500" yMin="103.476200" xMax="184.989342" yMax="112.116200">much</word>
<word xMin="193.264500" yMin="103.476200" xMax="208.328117" yMax="112.116200">im-</word>
</line>
<line xMin="40.474500" yMin="111.886200" xMax="208.357140" yMax="120.526200">
<word xMin="40.474500" yMin="111.886200" xMax="72.018180" yMax="120.526200">pressed</word>
<word xMin="76.694500" yMin="111.886200" xMax="95.959076" yMax="120.526200">with</word>
<word xMin="100.434500" yMin="111.886200" xMax="114.159768" yMax="120.526200">the</word>
<word xMin="119.164500" yMin="111.886200" xMax="152.601259" yMax="120.526200">manner</word>
<word xMin="157.234500" yMin="111.886200" xMax="173.199151" yMax="120.526200">and</word>
<word xMin="177.844500" yMin="111.886200" xMax="208.357140" yMax="120.526200">success</word>
</line>
```
We've been swaping the page width and height if the page is rotated so it matches with the content coorindates.
```
void printDocBBox(FILE *f, PDFDoc *doc, TextOutputDev *textOut, int first, int last)
{
double xMin, yMin, xMax, yMax;
const TextFlow *flow;
const TextBlock *blk;
const TextLine *line;
fprintf(f, "<doc>\n");
for (int page = first; page <= last; ++page) {
double wid = useCropBox ? doc->getPageCropWidth(page) : doc->getPageMediaWidth(page);
double hgt = useCropBox ? doc->getPageCropHeight(page) : doc->getPageMediaHeight(page);
//----------------------------------------//
// Veridian CUSTOMISATION [START]
//----------------------------------------//
// DisplayPage rotates the page back to 0 degree but the width/height functions do not consider the rotation and as a result it creates a discrepency.
int rot = doc->getPageRotate(page) % 360;
if (rot == 90 || rot == 270) {
double tmp = wid;
wid = hgt;
hgt = tmp;
}
//----------------------------------------//
// Veridian CUSTOMISATION [END]
//----------------------------------------//
fprintf(f, " <page width=\"%f\" height=\"%f\">\n", wid, hgt);
doc->displayPage(textOut, page, resolution, resolution, 0, !useCropBox, useCropBox, false);
for (flow = textOut->getFlows(); flow; flow = flow->getNext()) {
fprintf(f, " <flow>\n");
for (blk = flow->getBlocks(); blk; blk = blk->getNext()) {
blk->getBBox(&xMin, &yMin, &xMax, &yMax);
fprintf(f, " <block xMin=\"%f\" yMin=\"%f\" xMax=\"%f\" yMax=\"%f\">\n", xMin, yMin, xMax, yMax);
for (line = blk->getLines(); line; line = line->getNext()) {
printLine(f, line);
}
fprintf(f, " </block>\n");
}
fprintf(f, " </flow>\n");
}
fprintf(f, " </page>\n");
}
fprintf(f, "</doc>\n");
}
```https://gitlab.freedesktop.org/poppler/poppler/-/issues/1293Need a way to shutdown NSS before atexit2022-10-16T10:14:30ZAlbert Astals CidNeed a way to shutdown NSS before atexitMy understanding from the logs in https://bugs.kde.org/show_bug.cgi?id=459174 is that eidmiddleware also uses atexit and it gets triggered before poppler's one, so when poppler does the nss shutdown via atexit it ends up trying to free m...My understanding from the logs in https://bugs.kde.org/show_bug.cgi?id=459174 is that eidmiddleware also uses atexit and it gets triggered before poppler's one, so when poppler does the nss shutdown via atexit it ends up trying to free memory that was already freed.https://gitlab.freedesktop.org/poppler/poppler/-/issues/1291Bad rendering of data matrix code in Okular (blurry in some conditions)2022-12-28T12:54:11ZPotomacBad rendering of data matrix code in Okular (blurry in some conditions)I notice a problem with the last version of Okular (22.08.0), poppler is used by Okular with Qt5,
the rendering of data matrix image (a kind of QR code) is sometimes blurry, when the data matrix is small,
I notice this problem when buy...I notice a problem with the last version of Okular (22.08.0), poppler is used by Okular with Qt5,
the rendering of data matrix image (a kind of QR code) is sometimes blurry, when the data matrix is small,
I notice this problem when buying french PDF stamps from la poste website,
https://www.laposte.fr/mon-timbre-en-ligne
Here is a comparison between Okular and Xpdf for the same PDF, Okular doesn't manage to display a sharp rendering of the data matrix, and Xpdf doesn't have problem, the data matrix is sharp :
![bug_data_matrix](/uploads/8cc009d917b35c2e48c5c201c9b4f238/bug_data_matrix.png)
With firefox as PDF reader there is no problem.
I am not sure if poppler is the culprit, or if Okular (or Qt5 interface) doesn't use correctly poppler.
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch linux
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5https://gitlab.freedesktop.org/poppler/poppler/-/issues/1288incorrect pdf rendering2022-08-22T08:42:14Zjindam vaniincorrect pdf rendering* open pdf file [695582.pdf](/uploads/18cb9bad6caa41536540ceb78fa6160b/695582.pdf)
* pdf incorrect rendering on debian sid armhf, see below and comparing screenshots
* adobe ![adobe](/uploads/7b6037fed9f51c20115496c545ab3d29/adobe.jpg)...* open pdf file [695582.pdf](/uploads/18cb9bad6caa41536540ceb78fa6160b/695582.pdf)
* pdf incorrect rendering on debian sid armhf, see below and comparing screenshots
* adobe ![adobe](/uploads/7b6037fed9f51c20115496c545ab3d29/adobe.jpg)
* qpdfview ![qpdfview](/uploads/9ebc791a269990a2cc045aa2fdb193ce/qpdfview.jpg)
* evince ![evince](/uploads/c18ad70e52c809a70cca81b64475cfcd/evince.jpg)
* versions:
* libpoppler 22.02.0-3
* adobe acrobat reader 22.7.1.23191
* qpdfview 0.4.18
* evince 43.alphahttps://gitlab.freedesktop.org/poppler/poppler/-/issues/1287Reachable assertion when executing pdftocairo2022-08-24T05:19:30ZcrtReachable assertion when executing pdftocairoWe found a reachable assertion when executing pdftocairo. I am not sure if this is a problem in `poppler` or `libcairo.so` as the reachable assertion locates at libcairo.so. The version of libcairo.so is 1.16.0-6.
To reproduce, run `pd...We found a reachable assertion when executing pdftocairo. I am not sure if this is a problem in `poppler` or `libcairo.so` as the reachable assertion locates at libcairo.so. The version of libcairo.so is 1.16.0-6.
To reproduce, run `pdftocairo -svg $poc`
The error message is `pdftocairo: ../../../../src/cairo-path-stroke-polygon.c:829: normalize_slope: Assertion 'dx0 != 0.0 || dy0 != 0.0 failed.'`
The backtrace is
```
#0 0x00007ffff728983c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff723da52 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff7228469 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff7228395 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff7236b02 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007ffff7ec6d53 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#6 0x00007ffff7ec7047 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#7 0x00007ffff7ec7be2 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#8 0x00007ffff7ec489a in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#9 0x00007ffff7ec8ca0 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#10 0x00007ffff7ec2c94 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#11 0x00007ffff7e94825 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#12 0x00007ffff7ef6346 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#13 0x00007ffff7ef28cd in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#14 0x00007ffff7ede47f in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#15 0x00007ffff7edfacb in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#16 0x00007ffff7ec1f9c in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#17 0x00007ffff7ec247d in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#18 0x00007ffff7ef6aa8 in cairo_surface_show_page ()
from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#19 0x0000555555560724 in endPage (imageFileName=0x0)
at /home/users/chluo/poppler/utils/pdftocairo.cc:731
#20 main (argc=<optimized out>, argv=<optimized out>)
at /home/users/chluo/poppler/utils/pdftocairo.cc:1240
```
[poc](/uploads/ddbec4de0bbc0850a88d1a0f54026b87/poc)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1280Signing a form generated by pdflatex does not show appearance data2022-10-27T19:18:00ZErich HooverSigning a form generated by pdflatex does not show appearance dataIf you use pdflatex to generate the form data for the PDF then the "appearance" does not show. For example, if you use the following latex to generate a PDF:
```
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{Form...If you use pdflatex to generate the form data for the PDF then the "appearance" does not show. For example, if you use the following latex to generate a PDF:
```
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{Form}
Test
\end{Form}
\end{document}
```
and then open the resulting document in Okular ([test-sign.pdf](/uploads/8953978d4a66be0a626825b05898e133/test-sign.pdf)) and sign it then it will appear blank:
![image](/uploads/069b13b3a3dbe3bce4c376be5618924d/image.png)
However, if you remove the `\begin{Form}` and `\end{Form}`, regenerate the PDF, and try to sign that then the appearance data shows up properly:
![image](/uploads/57bae51875abd7331b7b57711e6dafd3/image.png)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1279pdfsig: Failed Certificate Validation not reflected in exit code2022-08-04T15:25:20ZKurt Garloffpdfsig: Failed Certificate Validation not reflected in exit codeSigning a PDF with a signature that comes from my own CA, I ask pdfsig (22.02 from Jammy) to validate it.
```
garloff@TuxKurt(//):~ [0]$ pdfsig Documents/TandC_signed2.pdf
Digital Signature Info of: Documents/TandC_signed2.pdf
Signature...Signing a PDF with a signature that comes from my own CA, I ask pdfsig (22.02 from Jammy) to validate it.
```
garloff@TuxKurt(//):~ [0]$ pdfsig Documents/TandC_signed2.pdf
Digital Signature Info of: Documents/TandC_signed2.pdf
Signature #1:
- Signer Certificate Common Name: XXXXX
- Signer full Distinguished Name: E=XXXX,CN=XXXX,O=XXXX,L=XXX,ST=XX,C=XX
- Signing Time: Jul 29 2022 18:56:40
- Signing Hash Algorithm: SHA-256
- Signature Type: adbe.pkcs7.detached
- Signed Ranges: [0 - 22564], [28158 - 28518]
- Total document signed
- Signature Validation: Signature is Valid.
- Certificate Validation: Certificate issuer is unknown.
garloff@TuxKurt(//):~ [0]$
```
So (unlike most GUI tools, such as e.g. okluar-22.04) it correctly detects that the issuer is unknown/untrusted.
BUT: It still returns 0 as exit code, requiring a wrapper that parses the textual output to detect the untrustedness. Which is not good. (Complex, and not robust.)
I would expect the exit code to be non-zero (unless -nocert is passed of course).
If we are afraid of breaking existing workflows, we could pass an option -strictcert or so to control the expected behavior.https://gitlab.freedesktop.org/poppler/poppler/-/issues/1277[pdftocairo] transparency type "multiply" isn't rendered correctly2022-07-28T22:35:09Ztobwen[pdftocairo] transparency type "multiply" isn't rendered correctly# bug
Transparency with type "multiply" isn't rendered
![output](/uploads/3fae1df273b8ee9f3cffb5dabed9eef0/output.png)
# tested commit
2e3c53b71f78b13f2afdb122c2d59243de70ac45
# reproduce me
[multiply.pdf](/uploads/8fe934448f320218a8e...# bug
Transparency with type "multiply" isn't rendered
![output](/uploads/3fae1df273b8ee9f3cffb5dabed9eef0/output.png)
# tested commit
2e3c53b71f78b13f2afdb122c2d59243de70ac45
# reproduce me
[multiply.pdf](/uploads/8fe934448f320218a8e8a9e54c6d7503/multiply.pdf)
``` shell
pdftocairo -r 600 -png -singlefile -antialias best multiply.pdf output
```
# reference image
Reference image was rendered with Illustrator CC 2022. Acrobat, Photoshop and others render it equally.
![reference](/uploads/6cf541c6d1649d30d96a1071e6fbefa0/reference.png)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1269heap-buffer-overflow in poppler_page_find_text_with_options2022-07-14T15:57:25ZIlya Yegorovheap-buffer-overflow in poppler_page_find_text_with_optionsHi!
I've been fuzzing your project and found heap-buffer-overflow in `poppler_page_find_text_with_options`.
In line 858 of `poppler-page.cc` you use `text` as first arg of `g_utf8_to_ucs4_fast()` without checking that `text` is valid ...Hi!
I've been fuzzing your project and found heap-buffer-overflow in `poppler_page_find_text_with_options`.
In line 858 of `poppler-page.cc` you use `text` as first arg of `g_utf8_to_ucs4_fast()` without checking that `text` is valid UTF-8 str.
Exception occurs when opening [crash-23a1f09c3261d49a770ec27633f2b8cb6bd299f1](/GNOME/glib/uploads/2e619b1570b361083c924c4c9c4b8dce/crash-23a1f09c3261d49a770ec27633f2b8cb6bd299f1) file.
You can use docker and fuzz targets from [oss-sydr-fuzz](https://github.com/ispras/oss-sydr-fuzz/tree/master/projects/poppler) to reproduce error:
` /out/find_text_fuzzer ./crash-23a1f09c3261d49a770ec27633f2b8cb6bd299f1`
Libfuzzer's output:
`==192==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61d00000c73f at pc 0x000003aed580 bp 0x7ffe83817120 sp 0x7ffe83817118
READ of size 1 at 0x61d00000c73f thread T0
#0 0x3aed57f in g_utf8_to_ucs4_fast /src/libfuzzer/glib-2.73.1/_builddir/../glib/gutf8.c:773:30
#1 0x6a2727 in poppler_page_find_text_with_options /src/libfuzzer/poppler/glib/poppler-page.cc:858:12
#2 0x6a4d7e in poppler_page_find_text /src/libfuzzer/poppler/glib/poppler-page.cc:921:12
#3 0x5ed796 in LLVMFuzzerTestOneInput /src/libfuzzer/poppler/glib/tests/fuzzing/find_text_fuzzer.cc:34:9
#4 0x51a041 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
#5 0x503f5c in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
#6 0x509cab in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
#7 0x533242 in main /llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#8 0x7febc80920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#9 0x4fe87d in _start (/out/find_text_fuzzer+0x4fe87d)
0x61d00000c73f is located 0 bytes to the right of 2239-byte region [0x61d00000be80,0x61d00000c73f)
allocated by thread T0 here:
#0 0x5b41c2 in __interceptor_calloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:138:3
#1 0x5ed475 in LLVMFuzzerTestOneInput /src/libfuzzer/poppler/glib/tests/fuzzing/find_text_fuzzer.cc:25:19
#2 0x51a041 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
#3 0x503f5c in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
#4 0x509cab in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
#5 0x533242 in main /llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#6 0x7febc80920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libfuzzer/glib-2.73.1/_builddir/../glib/gutf8.c:773:30 in g_utf8_to_ucs4_fast
Shadow bytes around the buggy address:
0x0c3a7fff9890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c3a7fff98a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c3a7fff98b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c3a7fff98c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c3a7fff98d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c3a7fff98e0: 00 00 00 00 00 00 00[07]fa fa fa fa fa fa fa fa
0x0c3a7fff98f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c3a7fff9900: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c3a7fff9910: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c3a7fff9920: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c3a7fff9930: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==192==ABORTING
`https://gitlab.freedesktop.org/poppler/poppler/-/issues/1268Integer overflow in readPatternDictSeg2022-07-21T17:42:33ZIlya YegorovInteger overflow in readPatternDictSegHi!
I've been fuzzing your project and found integer overflow in readPatternDictSeg.
In the line 2505 of JBIG2Stream.cc you use `(grayMax + 1) * patternW` as second arg of readPatternDictSeg without integer overflow check.
Exception occ...Hi!
I've been fuzzing your project and found integer overflow in readPatternDictSeg.
In the line 2505 of JBIG2Stream.cc you use `(grayMax + 1) * patternW` as second arg of readPatternDictSeg without integer overflow check.
Exception occurs when opening [sydr_e70b1aedf122b0ba90dcd2d104560befbb2f8d5c_int_overflow_33_signed](/uploads/e59f2d9c7171b06ce1865559b3ed1c92/sydr_e70b1aedf122b0ba90dcd2d104560befbb2f8d5c_int_overflow_33_signed) file. You can use docker and fuzz targets from [oss-sydr-fuzz](https://github.com/ispras/oss-sydr-fuzz/tree/master/projects/poppler) to reproduce error:
`/out/page_label_fuzzer ./sydr_e70b1aedf122b0ba90dcd2d104560befbb2f8d5c_int_overflow_33_signed`
Libfuzzer's output:
`INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 1759908738
INFO: Loaded 1 modules (851926 inline 8-bit counters): 851926 [0x60afae8, 0x617fabe),
INFO: Loaded 1 PC tables (851926 PCs): 851926 [0x617fac0,0x6e7f820),
/out/page_label_fuzzer: Running 1 inputs 1 time(s) each.
Running: /fuzz/page_label-out/security-verified/sydr_e70b1aedf122b0ba90dcd2d104560befbb2f8d5c_int_overflow_33_signed
/src/libfuzzer/poppler/poppler/NameToCharCode.cc:129:16: runtime error: unsigned integer overflow: 17 * 2686153882 cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/libfuzzer/poppler/poppler/NameToCharCode.cc:129:16 in
/src/libfuzzer/poppler/poppler/PDFDoc.cc:364:21: runtime error: implicit conversion from type 'int' of value 226 (32-bit, signed) to type 'char' changed the value to -30 (8-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/libfuzzer/poppler/poppler/PDFDoc.cc:364:21 in
/src/libfuzzer/poppler/poppler/PDFDoc.cc:2000:30: runtime error: implicit conversion from type 'int' of value 226 (32-bit, signed) to type 'char' changed the value to -30 (8-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/libfuzzer/poppler/poppler/PDFDoc.cc:2000:30 in
/src/libfuzzer/poppler/poppler/Lexer.cc:587:20: runtime error: implicit conversion from type 'int' of value 254 (32-bit, signed) to type 'char' changed the value to -2 (8-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/libfuzzer/poppler/poppler/Lexer.cc:587:20 in
/src/libfuzzer/poppler/poppler/JBIG2Stream.cc:2505:51: runtime error: unsigned integer overflow: 1431663872 * 3 cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/libfuzzer/poppler/poppler/JBIG2Stream.cc:2505:51 in
/src/libfuzzer/poppler/poppler/JBIG2Stream.cc:2505:113: runtime error: implicit conversion from type 'unsigned int' of value 2155905145 (32-bit, unsigned) to type 'int' changed the value to -2139062151 (32-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/libfuzzer/poppler/poppler/JBIG2Stream.cc:2505:113 in
Bogus memory allocation size
/src/libfuzzer/poppler/poppler/Stream.cc:143:18: runtime error: implicit conversion from type 'int' of value 226 (32-bit, signed) to type 'char' changed the value to -30 (8-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/libfuzzer/poppler/poppler/Stream.cc:143:18 in
/src/libfuzzer/poppler/poppler/PDFDoc.cc:1966:26: runtime error: implicit conversion from type 'int' of value 226 (32-bit, signed) to type 'char' changed the value to -30 (8-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/libfuzzer/poppler/poppler/PDFDoc.cc:1966:26 in
Bogus memory allocation size
Executed /fuzz/page_label-out/security-verified/sydr_e70b1aedf122b0ba90dcd2d104560befbb2f8d5c_int_overflow_33_signed in 24 ms
***
*** NOTE: fuzzing was not performed, you have only
*** executed the target code on a fixed set of inputs.
***`https://gitlab.freedesktop.org/poppler/poppler/-/issues/1265Question about memory representation of embedded images2022-07-06T10:13:18ZpiegamesQuestion about memory representation of embedded imagesWhen I have a PopplerDocument and render it to a Cairo context (glib API) and that document contains images: Does the PopplerDocument object decompress the pixels upon initial load or will it re-load the image for every render call? (Or ...When I have a PopplerDocument and render it to a Cairo context (glib API) and that document contains images: Does the PopplerDocument object decompress the pixels upon initial load or will it re-load the image for every render call? (Or something in between, like decompressing the image only on first render and then keeping it cached in memory)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1264Shows double text on selection and copy2022-07-05T18:45:01ZOnkar RuikarShows double text on selection and copyI raised this issue in evince repo: https://gitlab.gnome.org/GNOME/evince/-/issues/1816.
As per their suggestions I am raising it in poppler.
Steps to reproduce:
- Open [typescript-handbook.pdf](/uploads/0973d55d71d66594071b21b79d4921ff...I raised this issue in evince repo: https://gitlab.gnome.org/GNOME/evince/-/issues/1816.
As per their suggestions I am raising it in poppler.
Steps to reproduce:
- Open [typescript-handbook.pdf](/uploads/0973d55d71d66594071b21b79d4921ff/typescript-handbook.pdf) (downloaded from
https://www.typescriptlang.org/assets/typescript-handbook.pdf)
- Go to section '_Static type-checking_' on page 8.
- Select the error message in the code section.
- It shows double text for selection and when copied and pasted, it pastes the text twice.
> ![screenshot](https://gitlab.gnome.org/GNOME/evince/uploads/a8b4dc13780b84fb64caa084cb53eb90/XpArM6s.png)
As per the [comments](https://gitlab.gnome.org/GNOME/evince/-/issues/1816#note_1489991) the issue seems to be with poppler versions 22.05 and 22.06. And is not reproducible on v22.02.
Environment:
- Document Viewer v42.2
- Fedora 36 64-bithttps://gitlab.freedesktop.org/poppler/poppler/-/issues/1262Misrendering for a path with a gradient2022-06-27T09:57:34ZJussi PakkanenMisrendering for a path with a gradientThe attached PDF file renders incorrectly. Both Inkscape and Adobe Reader render it correctly.
I have also attached an image showing the difference between the two.
This happens with Okular on Kubuntu 22/04.
Thanks,
![renderings](/up...The attached PDF file renders incorrectly. Both Inkscape and Adobe Reader render it correctly.
I have also attached an image showing the difference between the two.
This happens with Okular on Kubuntu 22/04.
Thanks,
![renderings](/uploads/361ab5ca8a5ab81dcd4ab74f68f54db2/renderings.png)
[renderbug.pdf](/uploads/3b755897207f41410cfa3f149787634c/renderbug.pdf)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1256gradient image in pdf renders incorrectly2022-06-22T09:15:31Zhack_arsenicgradient image in pdf renders incorrectlyThe image in attached pdf renders incorrectly on both poppler backends (splash and cairo). The gradient is red instead of orange and is not rendered right.
Tried with xpdf and result was correct.
[test_red.pdf](/uploads/984fe6df7534a1b7...The image in attached pdf renders incorrectly on both poppler backends (splash and cairo). The gradient is red instead of orange and is not rendered right.
Tried with xpdf and result was correct.
[test_red.pdf](/uploads/984fe6df7534a1b7a8c55c5cfebb4486/test_red.pdf)
<details><summary>adobe reader</summary>
![adobe_reader](/uploads/e16697936e0e0c6dfce53ec6ccfc1839/adobe_reader.jpg)
</details>
<details><summary>poppler rendered</summary>
![poppler_rendered](/uploads/694901684079480283e74720b0e3dd40/poppler_rendered.jpg)
</details>
<details><summary>xpdf rendered</summary>
![xpdf_rendered](/uploads/f950dabea0e1bff9ae2f943e703de722/xpdf_rendered.png)
</details>https://gitlab.freedesktop.org/poppler/poppler/-/issues/1254Deleted annotations are just made invisible. They're still in the PDF document.2022-08-12T21:10:59ZWill MarksonDeleted annotations are just made invisible. They're still in the PDF document.1. Add an annotation containing the text `foobar` and save.
2. Delete it and save.
3. Find it in a text editor by searching for `f.o.o.b.a.r` or `FreeText`.
This is a flaw with poppler because evince, okular, atril, and every other FOSS...1. Add an annotation containing the text `foobar` and save.
2. Delete it and save.
3. Find it in a text editor by searching for `f.o.o.b.a.r` or `FreeText`.
This is a flaw with poppler because evince, okular, atril, and every other FOSS PDF reader that use poppler will have this serious privacy violation. No such issue if deleting a PDF with master pdf editor OR adobe acrobat DC. If the two mentioned PDF editors can remove an annotation without the annotation being left in the PDF document for anyone with vi to find, poppler can as well.https://gitlab.freedesktop.org/poppler/poppler/-/issues/1253Okular fails to render some mathematical symbols in PDF2023-08-18T10:52:10ZCorentin PoupryOkular fails to render some mathematical symbols in PDFOkular does not correctly render some mathematical symbols in some PDFs I use as a student. I found a reference to a similar bug here https://bugs.freedesktop.org/show_bug.cgi?id=32237
I can't provide the PDF here for copyright reasons,...Okular does not correctly render some mathematical symbols in some PDFs I use as a student. I found a reference to a similar bug here https://bugs.freedesktop.org/show_bug.cgi?id=32237
I can't provide the PDF here for copyright reasons, but I could send it to a developer
STEPS TO REPRODUCE
1. Open the PDF
2. Note that some symbols are missing
OBSERVED RESULT
Some symbols are missing and make the document uninterpretable
![With Okular](/uploads/d264a993294d2207fca9f2a3d4c6a828/__UTF-8_Q_with_5Fokular_2Epng__.png)
EXPECTED RESULT
The document symbols should be interpretable
![With Firefox](/uploads/d9fe3a170503d652e939b744b884eb3e/__UTF-8_Q_with_5Ffirefox_2Epng__.png)
Poppler: 22.05.0https://gitlab.freedesktop.org/poppler/poppler/-/issues/1251Annotation cut off2022-05-16T14:51:57ZDmitry ShubinAnnotation cut offSteps to reproduce:
- Open the attached [greysheet_sample.pdf](/uploads/ec9f45bf9b1b79999748c3b73d985d95/greysheet_sample.pdf)
- Convert page 2 to svg and to png, by executing
```
pdftocairo -svg -f 2 -l 2 greysheet_sample.pdf greyshee...Steps to reproduce:
- Open the attached [greysheet_sample.pdf](/uploads/ec9f45bf9b1b79999748c3b73d985d95/greysheet_sample.pdf)
- Convert page 2 to svg and to png, by executing
```
pdftocairo -svg -f 2 -l 2 greysheet_sample.pdf greysheet_sample.pdf.p2.poppler2205.svg
pdftocairo -png -f 2 -l 2 greysheet_sample.pdf greysheet_sample.pdf.p2.poppler2205.png
```
- Expected: the watermark looks the same way in svg and png and consistent to other PDF viewers
- Actual: while the PNG output looks good, the watermark in the SVG output is cut off on right and bottom sides: [greysheet_sample.pdf.p2.poppler2205.png-02](/uploads/00bf5125f7acc9d5490e97da07f8ddd8/greysheet_sample.pdf.p2.poppler2205.png-02.png), [greysheet_sample.pdf.p2.poppler2205.svg](/uploads/03045a6d33789fbbb49ed4cba1f631dc/greysheet_sample.pdf.p2.poppler2205.svg)
![greysheet_sample.png-vs-svg](/uploads/88de1e4e8c32bc731542d887ee27c995/greysheet_sample.png-vs-svg.png)
Reproduced against poppler 22.05.0https://gitlab.freedesktop.org/poppler/poppler/-/issues/1249pdfimages won't export images in hidden elements2022-05-14T08:15:04ZSven Hessepdfimages won't export images in hidden elements**TL;DR:**
Since pdfimages works by creating a fake output device that ignore all draw calls except for images, and poppler of course doesn't issue draw calls for hidden elements, this means that pdfimages doesn't extract images on such...**TL;DR:**
Since pdfimages works by creating a fake output device that ignore all draw calls except for images, and poppler of course doesn't issue draw calls for hidden elements, this means that pdfimages doesn't extract images on such hidden elements.
There should be a way in poppler, probably to ignore or override all "hidden" settings, so that all elements are always displayed. This option can then be used by pdfimages to grab all images.
**Long explanation follows:**
Note: the PDFs I talk about are non-free/commercial in nature, so I can't provide a sample. One example is here, but again, proprietary: https://paizo.com/products/btpy8src?Pathfinder-Adventure-Path-Skull-Shackles-Interactive-Maps . Hopefully, my description is enough to give a clue on what is going on and could be done about it.
My use-case is the following: I GM several groups of Pathfinder and because of the pandemic, this has mostly shifted online now. Luckily, Paizo offers PDFs for all their Pathfinder products and I can use pdfimages to grab those images and use them in my personal games. Several PDFs I use of theirs are their "Interactive Maps", which are PDFs with several pages of battlemaps used in their adventure modules, with buttons that allow you to show/hide the grid and sometimes show/hide GM-only information (that makes them "interactive", I guess).
Now, evince or any other Linux PDF viewer don't seem to support those buttons. Clicking on them does nothing and only the gridded versions of the maps are show. When I run pdfimages over such a file, I only get the gridded versions of the map.
However, one program that runs on Linux does support the buttons: masterpdfeditor (it's a commercial program, tho, and I only used the demo version). And while it can normally save images, it can't save the images on the elements that holds the maps. But: when I use masterpdfeditor to click on a button that switches a map to the gridless version, save a copy of the PDF (which adds a watermark to the PDF in the demo version, but here it doesn't matter) and then run pdfimages on that copy, I _do_ get the gridless version of the map!
Looking at the PDF in masterpdfeditor, I can see that the way Paizo implemented that feature is a bit of a hack: those elements that hold the map, they're not image elements. Instead, they're _form_ elements, also buttons to be precise, with custom icons, and those icons are the map images. So, if you click on the button to switch display of the map from gridded to gridless, the buttons that you click has Actions on it that first shows the button that contains the gridless version of the map, then hides the button that contains the gridded version of the map, giving the illusion of switching off the grid. (And then the button you click also does the same switcheroo with itself, so the text on the button you click changes to show the changed state.)
This explains why masterpdfeditor can't save the images here: because save image is only implemented for image elements, not form buttons.
It also explains why pdfimages only grabs the current state (which I had to find out afterwards, when I looked up how pdfimages is actually implemented): for a hidden form element, there's of course no draw calls issued.
I sat down and traced pdfimages/poppler to see where the hidden state is decided, and found that the check at the top of Annot::isVisible() is responsible. Literally, this one line change "fixes" my use-case for me: https://github.com/DrMcCoy/poppler/commit/5f8ea1663e5058b2bbdf3553af4d4b1783a9c8cc . With that, pdfimages always grabs all the images in Paizo's Pathfinder Interactive Maps. (It's all from AnnotWidget, though, in case that matters.)
Now, this of course breaks normal PDF rendering, so it's of course not the correct fix. But the easy maybe-proper way, as I can see it, would be added a "overrideHidden" or something bool to the 6 or so method in the callstack there. That feels a bit...eh, and also, since there's already a few optional parameters on the functions there (Page::displaySlice(), et al), this isn't exactly "pretty".
Also, I'm not sure if there's no other places where such a change would be useful for pdfimages, if there's other elements that can be hidden that can have images on them.
**In conclusion:**
Basically, I'm throwing the ball to you here, to decide on what to do here, if anything.https://gitlab.freedesktop.org/poppler/poppler/-/issues/1242Feature Request: add drawSelection() implementation to Qt bindings2022-04-25T18:54:50ZxzFeature Request: add drawSelection() implementation to Qt bindingsTextOutput.h implements the `drawSelection()` interface (https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/poppler/TextOutputDev.h#L636), which is useful for applications to set highlight areas with text selection.
However, t...TextOutput.h implements the `drawSelection()` interface (https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/poppler/TextOutputDev.h#L636), which is useful for applications to set highlight areas with text selection.
However, this interface is not available in Qt binding. Specifically, QPainterOutputDev.h doesn't include this interface. As a result, Qt applications that relies on poppler for PDF rendering (notably, Okular) can't correctly display highlighted text area, because the font text can't be correctly inverted in a dark background. Below shows the text selection result on Okular (using QPainterOutputDev):
![image](/uploads/3c42e20b4029b7ad4a9996c7f0c8ee3e/image.png)
Meanwhile, Atril uses TextOutputDev, which renders the correct result:
![image](/uploads/c04f5cbea2c15cb9fc442f4863e2636b/image.png)