path: root/libspectre
AgeCommit message (Collapse)AuthorFilesLines
2020-04-26Move spectre_document_load_from_stream to spectre-private.h for nowAlbert Astals Cid2-9/+9
Not ready for the prime time
2020-04-13Make sure we don't read uninitialized memory from textAlbert Astals Cid1-0/+4
2020-04-10Initialize varibles if reading failsAlbert Astals Cid1-14/+30
This way we don't do uninitizlied memory uses later on oss-fuzz/21638
2020-04-09Fix uninitialized memory read on malformed documentsAlbert Astals Cid1-11/+13
2020-04-08Fix uninitialized memory read on malformed documentsAlbert Astals Cid1-2/+2
2020-04-08Fix crash on malformed filesAlbert Astals Cid1-6/+8
2020-03-28Fix memory leakAlbert Astals Cid1-1/+2
2020-03-10fix memory leak in ps.c:650Randy1-0/+1
2020-03-10Refactor spectre_document_load_from_data() -> _stream()Randy2-45/+18
2020-03-07fix memory leak in ps.c:603Randy1-0/+1
2020-03-07fix NULL-dereference in psscan.c:934Randy1-1/+1
2020-03-03fix NULL-dereference in psscan()Randy1-1/+1
2020-03-02Fix memory leakRandy1-3/+4
2020-02-29Add spectre_document_load_from_data(), update fuzz targetRandy2-7/+59
2020-02-18Refactor code so that psscan() can accept a FILE*, this will enable parsing ↵Randy3-11/+15
from fmemopen()'d buffers. I figured this should be merged separately before spectre_document_load_from_data() is added.
2019-12-08fix leak in spectre_device_render()Randy1-0/+3
2018-10-20spectre-gs: Remove support for old ghostscriptChristian Persch2-22/+8
Now that we require a recent ghostscript, we can remove the support for older versions.
2018-10-20spectre-gs: Enforce minimum ghostscript versionChristian Persch1-1/+11
Ghostscript versions before 9.24 had a critical vulnerability allowing to escape -dSAFER; refuse to do anything if the version is less than 9.24.
2018-10-19Make clang happyAlbert Astals Cid1-9/+2
ps.c:1875:9: warning: promoted type 'int' of K&R function parameter is not compatible with the parameter type 'char' declared in a previous prototype [-Wknr-promoted-parameter] char charP; ^ ps.c:197:88: note: previous declaration is here static char *readlineuntil PT((FileData, long, char **, long *, unsigned int *, char)); ^ ps.c:2212:13: warning: promoted type 'int' of K&R function parameter is not compatible with the parameter type 'unsigned short' declared in a previous prototype [-Wknr-promoted-parameter] PS_WORD val; ^ ps.c:206:48: note: previous declaration is here static PS_WORD reorder_word PT((PS_WORD));
2018-10-19Hide internal symbolsChristian Persch7-1/+59
Use hidden visibility by default and make only the public API symbols visible.
2018-10-19Make gcc happy about switch fallthroughAlbert Astals Cid1-0/+1
2018-10-19Fix crash with malformed documentAlbert Astals Cid1-1/+1
Closes issue #14
2017-01-15state what lib is printing the errorCaolán McNamara1-3/+3
and where it originally came from so its clear where "undefined -21" came from in cases like
2016-06-23Rotate documents correctly with newer libgs versionsMarek Kasik1-2/+106
Rotate result of rendering given by ghostscript when libgs >= 9.08.
2016-06-23spectre-gs: Add a method to get the libgs versionCarlos Garcia Campos2-1/+12
2016-04-02Fix the build with Ghostscript >= 9.18Carlos Garcia Campos1-0/+11
2014-09-03Revert "Rotate documents correctly"Carlos Garcia Campos4-102/+31
This reverts commit c0b7b178d455f00b21e6317376ab49324bddb340.
2014-06-09Rotate documents correctlyMarek Kasik4-31/+102
Set correct size of rendered images when a rotation is requested. Use "rotate" command to rotate documents instead of setting of "Orientation". Adjust offsets accordingly. Don't execute "setpagedevice" when rendering to "display" device.
2012-11-03build: Use CPPFLAGS instead of CFLAGS for compiling flagsCarlos Garcia Campos1-4/+1
2012-11-03ps: Fix comparison between signed and unsigned compile warningCarlos Garcia Campos1-2/+3
2012-08-08build: Don't use global INCLUDES var in makefilesCarlos Garcia Campos1-6/+6
2010-12-04Allocate at least 1 page in doc->pagesMarek Kasik1-5/+5
Allocate at least 1 page if there are no %%Pages: or %%Page: comments in the PS file (#31512).
2010-10-30Fix a crash with documents containing an invalid %%Pages: commentCarlos Garcia Campos1-0/+2
When failed to allocate memory for pages because of invalid %%Pages: comment, set maxpages to 0 to ignore the comment. Problem spotted by Marek Kasik. Fixes bug #30867.
2010-06-01Fix rendering of files with doseps header and EOF comment missingCarlos Garcia Campos1-1/+8
Fixes bug #27830.
2010-06-01Remove unneeded #includeCarlos Garcia Campos1-1/+0
See bug #27734.
2010-06-01Make Ghostscript not look first in the current directory for library filesCarlos Garcia Campos2-3/+5
2010-04-18Use %I64x format for DisplayHandle on Windows 64 bitsCarlos Garcia Campos1-1/+7
2010-04-06Fix a crash in pdf exporter when rendering failsCarlos Garcia Campos1-0/+6
2010-03-28Use the correct format string for DisplayHandle arg depending on the platformCarlos Garcia Campos1-2/+5
2010-02-21Fix compile warningCarlos Garcia Campos1-1/+1
2010-02-21Use spectre_gs_process() instead of spectre_gs_send_page() in pdf exporterCarlos Garcia Campos1-3/+40
When rendering with the display device we use a new gs instance for every page and we have to process prolog, setup and trailer for every page. PDF exporter is different, we use a single gs instance created in exporter_pdf_begin() and destroyed in exporter_pdf_end(). Now we use spectre_gs_process() to send prolog and setup in begin() and trailer in end() so that we just send the page contents in do_page(). Fixes bug #26592.
2010-02-21Make spectre_gs_process() public so that it can be used by exportersCarlos Garcia Campos2-1/+7
It's public in the internal private API
2010-02-21Ignore page order parameter of %%Pages if there's a %%PageOrder commentCarlos Garcia Campos1-3/+0
It caused problems in documents where there's a %%PageOrder after the %%Pages comment. See evince bug
2010-02-03Add -no-undefined to LDFLAGS for building w32 dllHib Eris1-1/+1
2010-02-03Use _vscprintf instead of vsnprintf when availableHib Eris1-1/+7
On Windows, if output was truncated, vsnprintf() does not return the number of characters which would have been written to the string if enough space had been available. To work around this, use _vcsprintf() instead.
2009-12-11Skip documents in the Prolog like Resource-FontCarlos Garcia Campos1-0/+14
Fixes bug #25573.
2009-10-19fix some warnings of sscanf scanning signed but ending up in unsignedAlbert Astals Cid1-5/+5
2009-10-10Remove internal copy of ghostscript headersCarlos Garcia Campos5-725/+0
They should be intalled by ghostscript since version 8.62.
2009-10-10[psgetpagebbox] return true if any of the coords are != 0 instead of all of themCarlos Garcia Campos1-1/+1
Fixes bug #24132.
2009-09-11Add missing first argument in exporter pdfCarlos Garcia Campos1-2/+3