diff --git a/coders/jp2.c b/coders/jp2.c
index a17cd8b..df08503 100644
--- a/coders/jp2.c
+++ b/coders/jp2.c
@@ -522,7 +522,7 @@
   for (y=0; y < (ssize_t) image->rows; y++)
   {
     q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
-    if (q == (const Quantum *) NULL)
+    if (q == (Quantum *) NULL)
       break;
     for (i=0; i < (ssize_t) number_components; i++)
       (void) jas_image_readcmpt(jp2_image,(short) components[i],0,