Unified · Split
| @@ -16,8 +16,6 @@ usage(void) · 15 unmodified lines | ||
| 16 | 16 | void |
| 17 | 17 | main(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 | 19 | int n, w, h, x, y, page; |
| 22 | 20 | uchar *rgb, d[8192]; |
| 23 | 21 | Jbig2Image *j; |
| @@ -42,13 +40,11 @@ main(int argc, char **argv) · 18 unmodified lines | ||
| 42 | 40 | werrstr("ctx_new"); |
| 43 | 41 | goto error; |
| 44 | 42 | } |
| 45 | − for(x = 0;; x += n){ | |
| 43 | + for(;;){ | |
| 46 | 44 | if((n = read(0, d, sizeof(d))) == 0) |
| 47 | 45 | break; |
| 48 | 46 | if(n < 0) |
| 49 | 47 | goto error; |
| 50 | − if(x == 0 && n >= 8 && memcmp(d, header, 8) != 0) | |
| 51 | − jbig2_data_in(ctx, header, sizeof(header)); | |
| 52 | 48 | if(jbig2_data_in(ctx, d, n) < 0){ |
| 53 | 49 | werrstr("data_in"); |
| 54 | 50 | goto error; |