From faf63fddad6efab9fa4dcb14cd290766722a7eec Mon Sep 17 00:00:00 2001 From: mayeut Date: Wed, 23 Sep 2015 21:09:19 +0200 Subject: [PATCH] Fix warning in rle4 decoding --- src/bin/jp2/convertbmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/jp2/convertbmp.c b/src/bin/jp2/convertbmp.c index 1131a599..0678d9d3 100644 --- a/src/bin/jp2/convertbmp.c +++ b/src/bin/jp2/convertbmp.c @@ -572,7 +572,7 @@ static OPJ_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN); for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) { - *pix = (j&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f); + *pix = (OPJ_UINT8)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU)); } } else { /* absolute mode */ @@ -598,7 +598,7 @@ static OPJ_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride if((j&1) == 0) { c1 = (OPJ_UINT8)getc(IN); } - *pix = (j&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f); + *pix = (OPJ_UINT8)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU)); } if(((c&3) == 1) || ((c&3) == 2)) { /* skip padding byte */ getc(IN);