tiff2pdf: palette bound check in t2p_sample_realize_palette()
fixes #82
This commit is contained in:
parent
3334704ebc
commit
3107393354
@ -3731,6 +3731,11 @@ tsize_t t2p_sample_realize_palette(T2P* t2p, unsigned char* buffer){
|
||||
for(i=sample_count;i>0;i--){
|
||||
palette_offset=buffer[i-1] * component_count;
|
||||
sample_offset= (i-1) * component_count;
|
||||
if(palette_offset + component_count > t2p->pdf_palettesize){
|
||||
TIFFError(TIFF2PDF_MODULE,
|
||||
"Error: palette_offset + component_count > t2p->pdf_palettesize");
|
||||
return 1;
|
||||
}
|
||||
for(j=0;j<component_count;j++){
|
||||
buffer[sample_offset+j]=t2p->pdf_palette[palette_offset+j];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user