From 81abe5b3bb652d99d6a0746f8b405feef4d1f7e6 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Tue, 23 Dec 2014 15:06:23 +0000 Subject: [PATCH] [trunk] fixed imagetoraw unsigned 16bits conversion (fixes issue 460) --- src/bin/jp2/convert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c index 3de635be..4273141f 100644 --- a/src/bin/jp2/convert.c +++ b/src/bin/jp2/convert.c @@ -2586,7 +2586,7 @@ static int imagetoraw_common(opj_image_t * image, const char *outfile, OPJ_BOOL for (line = 0; line < h; line++) { for(row = 0; row < w; row++) { curr = *ptr; - if(curr > 65536 ) curr = 65536; else if( curr < 0) curr = 0; + if(curr > 65535 ) curr = 65535; else if( curr < 0) curr = 0; uc16.val = (unsigned short)(curr & mask); res = fwrite(uc16.vals, 1, 2, rawFile); if( res < 2 ) {