Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0b8253c

Browse files
Fix: a coner case, when all oracles are zero
1 parent 6a2c43f commit 0b8253c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

blobstamper/galley.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ GalleyVector::extract_internal(Blob &blob)
129129
size_oracles.push_back(o);
130130
size_oracle_total += o;
131131
}
132+
if (size_oracle_total == 0) /* special case: if total size is zero (means all oracles are zero) we will spread data evenly between all items*/
133+
{
134+
for(int i = 0; i<count_target; i++)
135+
{
136+
size_oracles[i] = 1;
137+
size_oracle_total += 1;
138+
}
139+
}
132140

133141
/* Calculating available vairable size, that will be destributed between parts according to size oracles */
134142
int data_size = blob.Size();

0 commit comments

Comments
 (0)