Summary: | pdf_show_string can overwrite xref's scratch buffer when called from pdf_run_stream | ||
---|---|---|---|
Product: | MuPDF | Reporter: | zeniko |
Component: | mupdf | Assignee: | Tor Andersson <tor.andersson> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | pipping |
Priority: | P4 | ||
Version: | unspecified | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
URL: | http://code.google.com/p/sumatrapdf/issues/detail?id=1496 | ||
Customer: | Word Size: | --- |
Description
zeniko
2011-06-16 15:18:38 UTC
Something like --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -2138,8 +2138,10 @@ pdf_run_stream(pdf_csi *csi, fz_obj *rdb, fz_stream *file, char *buf, int buflen pdf_show_space(csi, -fz_atof(buf) * gstate->size * 0.001f); } else if (tok == PDF_TOK_STRING) - { + { /* cf. http://bugs.ghostscript.com/show_bug.cgi?id=692312 */ + csi->in_array = 0; pdf_show_string(csi, (unsigned char *)buf, len); + csi->in_array = 1; } else if (tok == PDF_TOK_KEYWORD) { indeed fixes the issue for me, thanks. I still get + pdf/pdf_xref.c:335: pdf_read_new_xref(): object id (37226 0 R) out of range (0..37225) | pdf/pdf_xref.c:411: pdf_read_xref(): cannot read xref (ofs=5260639) | pdf/pdf_xref.c:431: pdf_read_xref_sections(): cannot read xref section | pdf/pdf_xref.c:491: pdf_load_xref(): cannot read xref \ pdf/pdf_xref.c:532: pdf_open_xref_with_stream(): trying to repair on startup. I this related? (In reply to comment #1) > Something like > > --- a/pdf/pdf_interpret.c > +++ b/pdf/pdf_interpret.c > @@ -2138,8 +2138,10 @@ pdf_run_stream(pdf_csi *csi, fz_obj *rdb, fz_stream > *file, char *buf, int buflen > pdf_show_space(csi, -fz_atof(buf) * > gstate->size * 0.001f); > } > else if (tok == PDF_TOK_STRING) > - { > + { /* cf. > http://bugs.ghostscript.com/show_bug.cgi?id=692312 */ > + csi->in_array = 0; > pdf_show_string(csi, (unsigned char *)buf, > len); > + csi->in_array = 1; > } > else if (tok == PDF_TOK_KEYWORD) > { > > indeed fixes the issue for me, thanks. I still get > > + pdf/pdf_xref.c:335: pdf_read_new_xref(): object id (37226 0 R) out of range > (0..37225) > | pdf/pdf_xref.c:411: pdf_read_xref(): cannot read xref (ofs=5260639) > | pdf/pdf_xref.c:431: pdf_read_xref_sections(): cannot read xref section > | pdf/pdf_xref.c:491: pdf_load_xref(): cannot read xref > \ pdf/pdf_xref.c:532: pdf_open_xref_with_stream(): trying to repair > > on startup. I this related? oops. it's still early, so please ignore the above completely because I meant to post it on another bug :) Fixed in commit 7926d3cbd583e45e59532fa473713e7d54424811. |