mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-19 05:35:01 +00:00
Fix some fatal failures related to rendered frame memory size limits
This commit is contained in:
parent
1b50878f3f
commit
c16ee88b5d
7 changed files with 27 additions and 15 deletions
|
@ -341,11 +341,12 @@ mod image {
|
|||
|
||||
impl Hash for Image {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
const HASH_SAMPLES: usize = 1000;
|
||||
const HASH_SAMPLES: u64 = 1000;
|
||||
let data_length = self.data.len() as u64;
|
||||
self.width.hash(state);
|
||||
self.height.hash(state);
|
||||
for i in 0..HASH_SAMPLES.min(self.data.len()) {
|
||||
self.data[i * self.data.len() / HASH_SAMPLES].hash(state);
|
||||
for i in 0..HASH_SAMPLES.min(data_length) {
|
||||
self.data[(i * data_length / HASH_SAMPLES) as usize].hash(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue