Fail serialize when map has incorrect value
fixes https://crbug.com/oss-fuzz/19956 am not super happy with the fix, guess we should do some check before the memcpy anyway as @blueshade7 thinks also, so let's have it or revert it when we have a better approach for the case.
This commit is contained in:
parent
1db2c1d0da
commit
257a197ae7
|
@ -1906,8 +1906,13 @@ struct VarRegionList
|
|||
axisCount = src->axisCount;
|
||||
regionCount = region_map.get_population ();
|
||||
if (unlikely (!c->allocate_size<VarRegionList> (get_size () - min_size))) return_trace (false);
|
||||
unsigned int region_count = src->get_region_count ();
|
||||
for (unsigned int r = 0; r < regionCount; r++)
|
||||
memcpy (&axesZ[axisCount * r], &src->axesZ[axisCount * region_map.backward (r)], VarRegionAxis::static_size * axisCount);
|
||||
{
|
||||
unsigned int backward = region_map.backward (r);
|
||||
if (backward >= region_count) return_trace (false);
|
||||
memcpy (&axesZ[axisCount * r], &src->axesZ[axisCount * backward], VarRegionAxis::static_size * axisCount);
|
||||
}
|
||||
|
||||
return_trace (true);
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue