jdarith.c: Require cinfo->Se == DCTSIZE2 - 1

This fixes an oversight from the integration of the arithmetic entropy
codec from libjpeg (66f97e6820e2cc9ef7429ea36285c80ffda87c8f).  I chose
to integrate the latest implementation available at the time, which was
from jpeg-8b.  However, I naively replaced cinfo->lim_Se with
DCTSIZE2 - 1, not realizing that-- because of SmartScale-- jpeg-8b
contains additional code
that guards against illegal values of cinfo->Se >= DCTSIZE2.  Thus,
libjpeg-turbo's implementation of arithmetic decoding has never guarded
against such illegal values.  This commit restores the relevant check
from the original jpeg-6b arithmetic entropy codec patch ("jpeg-ari",

Fixes #564
1 file changed