tif_jpeg.c: avoid potential division in previous fix (master only)
This commit is contained in:
parent
c96a0232b7
commit
8405704ebb
@ -1212,11 +1212,14 @@ JPEGPreDecode(TIFF* tif, uint16 s)
|
||||
|
||||
for (ci = 0; ci < sp->cinfo.d.num_components; ci++) {
|
||||
const jpeg_component_info *compptr = &(sp->cinfo.d.comp_info[ci]);
|
||||
if( compptr->h_samp_factor > 0 && compptr->v_samp_factor > 0 )
|
||||
{
|
||||
nRequiredMemory += (toff_t)(
|
||||
((compptr->width_in_blocks + compptr->h_samp_factor - 1) / compptr->h_samp_factor)) *
|
||||
((compptr->height_in_blocks + compptr->v_samp_factor - 1) / compptr->v_samp_factor) *
|
||||
sizeof(JBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
if( sp->cinfo.d.mem->max_memory_to_use > 0 &&
|
||||
nRequiredMemory > (toff_t)(sp->cinfo.d.mem->max_memory_to_use) &&
|
||||
|
Loading…
Reference in New Issue
Block a user