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
1616 void
1717 main(int argc, char **argv)
1818 {
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 };
2119 int n, w, h, x, y, page;
2220 uchar *rgb, d[8192];
2321 Jbig2Image *j;
@@ -42,13 +40,11 @@ main(int argc, char **argv) · 18 unmodified lines
4240 werrstr("ctx_new");
4341 goto error;
4442 }
45− for(x = 0;; x += n){
43+ for(;;){
4644 if((n = read(0, d, sizeof(d))) == 0)
4745 break;
4846 if(n < 0)
4947 goto error;
50− if(x == 0 && n >= 8 && memcmp(d, header, 8) != 0)
51− jbig2_data_in(ctx, header, sizeof(header));
5248 if(jbig2_data_in(ctx, d, n) < 0){
5349 werrstr("data_in");
5450 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