summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-02-10 17:58:28 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-02-10 17:58:28 +0100
commit73196195c2223f2d3f5afbfc4aeef8801122b45b (patch)
tree9efca496efd59375481c86b79a9b9b86512df3ef
parent052e40758861fb983c5f88754af3fe4924294705 (diff)
parentf2646e054ce3d1bfa86471553e663b426a143ad8 (diff)
merge
-rw-r--r--src/PostscriptDSC.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/PostscriptDSC.cxx b/src/PostscriptDSC.cxx
index dfc9775..985722d 100644
--- a/src/PostscriptDSC.cxx
+++ b/src/PostscriptDSC.cxx
@@ -120,14 +120,18 @@ PostscriptDSC::parse(int fd) {
}
}
}
+
+ if (page_len && page_off) {
+ page_len[p1 - 1] = ftello(fp) - page_off[p1 - 1];
- page_len[p1 - 1] = ftello(fp) - page_off[p1 - 1];
-
- for (int i=0; i<pages; i++) {
- if (page_off[i] == 0 || page_len[i] == 0) {
- fprintf(stderr, "Page %d not defined\n", i);
- return 1;
+ for (int i=0; i<pages; i++) {
+ if (page_off[i] == 0 || page_len[i] == 0) {
+ fprintf(stderr, "Page %d not defined\n", i);
+ return 1;
+ }
}
+ } else {
+ return 1;
}
return 0;