summaryrefslogtreecommitdiffstats
path: root/deps/strigi/strigi.libstreamanalyzer.pdf.patch
diff options
context:
space:
mode:
Diffstat (limited to 'deps/strigi/strigi.libstreamanalyzer.pdf.patch')
-rw-r--r--deps/strigi/strigi.libstreamanalyzer.pdf.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/deps/strigi/strigi.libstreamanalyzer.pdf.patch b/deps/strigi/strigi.libstreamanalyzer.pdf.patch
new file mode 100644
index 0000000..f212523
--- /dev/null
+++ b/deps/strigi/strigi.libstreamanalyzer.pdf.patch
@@ -0,0 +1,27 @@
+commit 23d5ce636b7897dc3f233a5293f3164dac50566d
+Author: Jos van den Oever <jos@vandenoever.info>
+Date: Sun Jul 31 12:32:44 2011 +0200
+
+ Revert patch that breaks parsing of PDF files.
+ The offending patch was 672c8b7b3cb4400bc505421f4cc70cf742ed9df0.
+
+diff --git a/libstreamanalyzer/lib/pdf/pdfparser.cpp b/libstreamanalyzer/lib/pdf/pdfparser.cpp
+index c27f691..df2f7e5 100644
+--- a/libstreamanalyzer/lib/pdf/pdfparser.cpp
++++ b/libstreamanalyzer/lib/pdf/pdfparser.cpp
+@@ -34,12 +34,13 @@ StreamStatus
+ PdfParser::read(int32_t min, int32_t max) {
+ int32_t off = (int32_t)(pos-start);
+ int32_t d = (int32_t)(stream->position() - bufferStart);
+- bufferStart += off;
++ min += d;
++ if (max > 0) max += d;
+ stream->reset(bufferStart);
+ int32_t n = stream->read(start, min, max);
+ // printf("objstart %i %i\n", d, n);
+ if (n < min) return stream->status();
+- pos = start;
++ pos = start + off;
+ end = start + n;
+ return Ok;
+ }