Commit 07b73cfd authored by Even Rouault's avatar Even Rouault
Browse files

Merge branch 'remove_packbits_hack' into 'master'

PackBitsDecode: remove hack for when char is unsigned.

See merge request libtiff/libtiff!267
parents fc3e3a20 7fca7297
Pipeline #379264586 passed with stages
in 8 minutes and 50 seconds
......@@ -214,23 +214,17 @@ static int
PackBitsDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "PackBitsDecode";
char *bp;
int8_t *bp;
tmsize_t cc;
long n;
int b;
(void) s;
bp = (char*) tif->tif_rawcp;
bp = (int8_t*) tif->tif_rawcp;
cc = tif->tif_rawcc;
while (cc > 0 && occ > 0) {
n = (long) *bp++;
cc--;
/*
* Watch out for compilers that
* don't sign extend chars...
*/
if (n >= 128)
n -= 256;
if (n < 0) { /* replicate next byte -n+1 times */
if (n == -128) /* nop */
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment