Protect against possible division by zeros (#316468, Steve Grubb)
2005-11-23 Behdad Esfahbod <behdad@gnome.org> Protect against possible division by zeros (#316468, Steve Grubb) * pango/pango-context.c (update_metrics_from_items), pango/pango-fontset.c (pango_fontset_real_get_metrics): If count is zero, do not alter approximate_{char,digit}_width. * pango/opentype/disasm.c: Err on invalid DeltaFormat.
This commit is contained in:
parent
e6e15352d1
commit
682db81c23
10
src/disasm.c
10
src/disasm.c
|
@ -444,11 +444,18 @@ Dump_Device (TTO_Device *Device, FILE *stream, int indent, FT_Bool is_gsub)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DUMP ("<DeltaValue>");
|
||||||
|
if (!bits)
|
||||||
|
{
|
||||||
|
|
||||||
|
fprintf(stderr, "invalid DeltaFormat!!!!!\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
n_per = 16 / bits;
|
n_per = 16 / bits;
|
||||||
mask = (1 << bits) - 1;
|
mask = (1 << bits) - 1;
|
||||||
mask = mask << (16 - bits);
|
mask = mask << (16 - bits);
|
||||||
|
|
||||||
DUMP ("<DeltaValue>");
|
|
||||||
for (i = Device->StartSize; i <= Device->EndSize ; i++)
|
for (i = Device->StartSize; i <= Device->EndSize ; i++)
|
||||||
{
|
{
|
||||||
FT_UShort val = Device->DeltaValue[i / n_per];
|
FT_UShort val = Device->DeltaValue[i / n_per];
|
||||||
|
@ -457,6 +464,7 @@ Dump_Device (TTO_Device *Device, FILE *stream, int indent, FT_Bool is_gsub)
|
||||||
if (i != Device->EndSize)
|
if (i != Device->EndSize)
|
||||||
DUMP (", ");
|
DUMP (", ");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
DUMP ("</DeltaValue>\n");
|
DUMP ("</DeltaValue>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue