summaryrefslogtreecommitdiff
path: root/gpdl
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-01-28 17:35:37 +0000
committerRobin Watts <Robin.Watts@artifex.com>2020-01-28 17:38:50 +0000
commit9156c43b44b64c3928d2ef20f15d56bd44c6f897 (patch)
tree3df214ce21f16904959acfb7b10ec9009a79b47e /gpdl
parent85cf3b3a7befbed4811d9460dc6a4637f929f8ab (diff)
downloadghostpdl-9156c43b44b64c3928d2ef20f15d56bd44c6f897.tar.gz
gpdl: Update j2k reading code to spot modified header.
The JP2K spec says we should spot "jP ", where previously we'd only been spotting "jP\1a\1a". No idea where that latter one came from, but presumably we've been seeing it in some files. Make the code cope with both.
Diffstat (limited to 'gpdl')
-rw-r--r--gpdl/jp2ktop.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gpdl/jp2ktop.c b/gpdl/jp2ktop.c
index 76e17d91d..8e652217e 100644
--- a/gpdl/jp2ktop.c
+++ b/gpdl/jp2ktop.c
@@ -96,8 +96,7 @@ jp2k_detect_language(const char *s_, int len)
s[3] == 0x0C &&
s[4] == 0x6a &&
s[5] == 0x50 &&
- s[6] == 0x1a &&
- s[7] == 0x1a &&
+ ((s[6] == 0x1a && s[7] == 0x1a) || (s[6] == 0x20 && s[7] == 0x20)) &&
s[8] == 0x0d &&
s[9] == 0x0a &&
s[10] == 0x87 &&
@@ -412,8 +411,7 @@ do_process(jp2k_interp_instance_t *jp2k, stream_cursor_read * pr, bool eof)
s[3] == 0x0C &&
s[4] == 0x6a &&
s[5] == 0x50 &&
- s[6] == 0x1a &&
- s[7] == 0x1a &&
+ ((s[6] == 0x1a && s[7] == 0x1a) || (s[6] == 0x20 && s[7] == 0x20)) &&
s[8] == 0x0d &&
s[9] == 0x0a &&
s[10] == 0x87 &&