Other parts of the PPMD7 code assume that the dictionary is
at least UNIT_SIZE (12 bytes). Enforce that assumption here
to avoid potential buffer under- and over-runs.
This was pointed out in a review of the original fix for Issue 719.
{
if (p->Base == 0 || p->Size != size)
{
+ /* RestartModel() below assumes that p->Size >= UNIT_SIZE
+ (see the calculation of m->MinContext). */
+ if (size < UNIT_SIZE) {
+ return False;
+ }
Ppmd7_Free(p, alloc);
p->AlignOffset =
#ifdef PPMD_32BIT