diff --git a/coders/jp2.c b/coders/jp2.c
index a6a183b..1eb7b5a 100644
--- a/coders/jp2.c
+++ b/coders/jp2.c
@@ -248,7 +248,7 @@
     *image;
 
   image=(Image *) context;
-  return(SeekBlob(image,offset,SEEK_SET) < 0 ? 0 : 1);
+  return(SeekBlob(image,offset,SEEK_SET) < 0 ? OPJ_FALSE : OPJ_TRUE);
 }
 
 static OPJ_OFF_T JP2SkipHandler(OPJ_OFF_T offset,void *context)
@@ -257,7 +257,7 @@
     *image;
 
   image=(Image *) context;
-  return(SeekBlob(image,offset,SEEK_CUR) < 0 ? 0 : offset);
+  return(SeekBlob(image,offset,SEEK_CUR) < 0 ? -1 : offset);
 }
 
 static void JP2WarningHandler(const char *message,void *client_data)