History

remove header injection: pdffs does that now

Sigrid Solveig Haflínudóttir committed 5 years agomaster

Commit 6ec587d1 parent 0a396e41 file · +1 −5Browse files

Unified · Split

jb2.c+1−5
@@ -16,8 +16,6 @@ usage(void) · 15 unmodified lines
16void16void
17main(int argc, char **argv)17main(int argc, char **argv)
18{18{
19 /* this header is inserted in case the input stream doesn't have one (when extracted from a PDF) */
20 uchar header[] = { 0x97, 0x4a, 0x42, 0x32, 0x0d, 0x0a, 0x1a, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x01 };
21 int n, w, h, x, y, page;19 int n, w, h, x, y, page;
22 uchar *rgb, d[8192];20 uchar *rgb, d[8192];
23 Jbig2Image *j;21 Jbig2Image *j;
@@ -42,13 +40,11 @@ main(int argc, char **argv) · 18 unmodified lines
42 werrstr("ctx_new");40 werrstr("ctx_new");
43 goto error;41 goto error;
44 }42 }
45 for(x = 0;; x += n){43 for(;;){
46 if((n = read(0, d, sizeof(d))) == 0)44 if((n = read(0, d, sizeof(d))) == 0)
47 break;45 break;
48 if(n < 0)46 if(n < 0)
49 goto error;47 goto error;
50 if(x == 0 && n >= 8 && memcmp(d, header, 8) != 0)
51 jbig2_data_in(ctx, header, sizeof(header));
52 if(jbig2_data_in(ctx, d, n) < 0){48 if(jbig2_data_in(ctx, d, n) < 0){
53 werrstr("data_in");49 werrstr("data_in");
54 goto error;50 goto error;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t