about summary refs log tree commit diff
path: root/converter/other/jpeg2000/jpeg2ktopam.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-10-06 03:09:04 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-10-06 03:09:04 +0000
commit792fa6a1e266926fc412def2a5703f553ad73a29 (patch)
treee0eb4b4c918d1523ece45fac391c499cfaba162e /converter/other/jpeg2000/jpeg2ktopam.c
parent487f66697ad55524f590f34a5f53338f42533665 (diff)
downloadnetpbm-mirror-792fa6a1e266926fc412def2a5703f553ad73a29.tar.gz
netpbm-mirror-792fa6a1e266926fc412def2a5703f553ad73a29.tar.xz
netpbm-mirror-792fa6a1e266926fc412def2a5703f553ad73a29.zip
Improve JPEG2K format validation logic
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1000 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/jpeg2000/jpeg2ktopam.c')
-rw-r--r--converter/other/jpeg2000/jpeg2ktopam.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/converter/other/jpeg2000/jpeg2ktopam.c b/converter/other/jpeg2000/jpeg2ktopam.c
index e6db7658..bfcc0db9 100644
--- a/converter/other/jpeg2000/jpeg2ktopam.c
+++ b/converter/other/jpeg2000/jpeg2ktopam.c
@@ -99,10 +99,10 @@ readJpc(const char *   const inputFilename,
         if (instream == NULL )
             pm_error("cannot open input image file '%s'", inputFilename);
     } 
-
-    if (jas_image_getfmt(instream) != jas_image_strtofmt((char*)"jpc"))
+    assert(jas_image_lookupfmtbyname("jpc"));
+    if (jas_image_lookupfmtbyname("jpc")->ops.validate(instream) != 0)
         pm_error("Input is not JPEG-2000 code stream");
-
+        
     options = "";
 
     jasperP = jas_image_decode(instream, jas_image_strtofmt((char*)"jpc"),