Summary: | out of memory crash when processing PLRM.pdf on 1st generation iPad | ||
---|---|---|---|
Product: | MuPDF | Reporter: | Arthur Ford <arthur.k.ford> |
Component: | mupdf | Assignee: | Tor Andersson <tor.andersson> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | other | ||
Customer: | Word Size: | --- | |
Attachments: | PostScript Language Reference Manual |
Description
Arthur Ford
2011-10-29 17:16:42 UTC
Looks like the scale factors were off. The following resolved the problem: diff --git a/ios/main.m b/ios/main.m index 89614fc..1aeaa6e 100644 --- a/ios/main.m +++ b/ios/main.m @@ -153,8 +153,8 @@ static UIImage *renderPage(pdf_xref *xref, int number, float return nil; } - hscale = width / page->mediabox.x1 - page->mediabox.x0; - vscale = height / page->mediabox.y1 - page->mediabox.y0; + hscale = width / (page->mediabox.x1 - page->mediabox.x0); + vscale = height / (page->mediabox.y1 - page->mediabox.y0); scale = MIN(hscale, vscale); ctm = fz_translate(0, -page->mediabox.y1); Gah! Thanks for spotting this! |