Lines 237-242
LZWSetupDecode(TIFF* tif)
Link Here
|
237 |
sp->dec_codetab[code].length = 1; |
237 |
sp->dec_codetab[code].length = 1; |
238 |
sp->dec_codetab[code].next = NULL; |
238 |
sp->dec_codetab[code].next = NULL; |
239 |
} while (code--); |
239 |
} while (code--); |
|
|
240 |
/* |
241 |
* Zero-out the unused entries |
242 |
*/ |
243 |
_TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0, |
244 |
(CODE_FIRST-CODE_CLEAR)*sizeof (code_t)); |
245 |
|
240 |
} |
246 |
} |
241 |
return (1); |
247 |
return (1); |
242 |
} |
248 |
} |
Lines 415-420
LZWDecode(TIFF* tif, tidata_t op0, tsize
Link Here
|
415 |
NextCode(tif, sp, bp, code, GetNextCode); |
421 |
NextCode(tif, sp, bp, code, GetNextCode); |
416 |
if (code == CODE_EOI) |
422 |
if (code == CODE_EOI) |
417 |
break; |
423 |
break; |
|
|
424 |
if (code == CODE_CLEAR) { |
425 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
426 |
"LZWDecode: Corrupted LZW table at scanline %d", |
427 |
tif->tif_row); |
428 |
return (0); |
429 |
} |
418 |
*op++ = (char)code, occ--; |
430 |
*op++ = (char)code, occ--; |
419 |
oldcodep = sp->dec_codetab + code; |
431 |
oldcodep = sp->dec_codetab + code; |
420 |
continue; |
432 |
continue; |
Lines 612-617
LZWDecodeCompat(TIFF* tif, tidata_t op0,
Link Here
|
612 |
NextCode(tif, sp, bp, code, GetNextCodeCompat); |
624 |
NextCode(tif, sp, bp, code, GetNextCodeCompat); |
613 |
if (code == CODE_EOI) |
625 |
if (code == CODE_EOI) |
614 |
break; |
626 |
break; |
|
|
627 |
if (code == CODE_CLEAR) { |
628 |
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, |
629 |
"LZWDecode: Corrupted LZW table at scanline %d", |
630 |
tif->tif_row); |
631 |
return (0); |
632 |
} |
615 |
*op++ = code, occ--; |
633 |
*op++ = code, occ--; |
616 |
oldcodep = sp->dec_codetab + code; |
634 |
oldcodep = sp->dec_codetab + code; |
617 |
continue; |
635 |
continue; |