|
Lines 237-242
LZWSetupDecode(TIFF* tif)
|
Link Here
|
|---|
|
sp->dec_codetab[code].length = 1; | sp->dec_codetab[code].length = 1; |
sp->dec_codetab[code].next = NULL; | sp->dec_codetab[code].next = NULL; |
} while (code--); | } while (code--); |
|
/* |
|
* Zero-out the unused entries |
|
*/ |
|
_TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0, |
|
(CODE_FIRST-CODE_CLEAR)*sizeof (code_t)); |
|
|
} | } |
return (1); | return (1); |
} | } |
|
Lines 415-420
LZWDecode(TIFF* tif, tidata_t op0, tsize
|
Link Here
|
|---|
|
NextCode(tif, sp, bp, code, GetNextCode); | NextCode(tif, sp, bp, code, GetNextCode); |
if (code == CODE_EOI) | if (code == CODE_EOI) |
break; | break; |
|
if (code == CODE_CLEAR) { |
|
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
|
"LZWDecode: Corrupted LZW table at scanline %d", |
|
tif->tif_row); |
|
return (0); |
|
} |
*op++ = (char)code, occ--; | *op++ = (char)code, occ--; |
oldcodep = sp->dec_codetab + code; | oldcodep = sp->dec_codetab + code; |
continue; | continue; |
|
Lines 612-617
LZWDecodeCompat(TIFF* tif, tidata_t op0,
|
Link Here
|
|---|
|
NextCode(tif, sp, bp, code, GetNextCodeCompat); | NextCode(tif, sp, bp, code, GetNextCodeCompat); |
if (code == CODE_EOI) | if (code == CODE_EOI) |
break; | break; |
|
if (code == CODE_CLEAR) { |
|
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
|
"LZWDecode: Corrupted LZW table at scanline %d", |
|
tif->tif_row); |
|
return (0); |
|
} |
*op++ = code, occ--; | *op++ = code, occ--; |
oldcodep = sp->dec_codetab + code; | oldcodep = sp->dec_codetab + code; |
continue; | continue; |