c
int remainder;
if (!safe_divide(td->td_tilelength, sp->v_sampling * DCTSIZE, &remainder)) {
    TIFFErrorExt(tif->tif_clientdata, module,
                 "Invalid JPEG sampling factor or DCT size");
    return (0);
}

if (remainder != 0) {
    TIFFErrorExt(tif->tif_clientdata, module,
                 "JPEG tile height must be multiple of %d",
                 sp->v_sampling * DCTSIZE);
    return (0);
}
